fork(4) download
  1. {-# LANGUAGE BangPatterns #-}
  2. module Main where
  3.  
  4. import Data.Int
  5. import Data.Time.Clock
  6.  
  7. main :: IO ()
  8. main = do
  9. start <- getCurrentTime
  10. let m = (1000000 :: Int64)
  11. a = [0, 2 .. m]
  12. b = [m, m-2 .. 0]
  13. !dot = sum $ map (\(x1, x2) -> x1 * x2) $ zip a b
  14. end <- getCurrentTime
  15. print dot
  16. print (end `diffUTCTime` start)
  17.  
Success #stdin #stdout 0.09s 4680KB
stdin
Standard input is empty
stdout
83333333333000000
0.096844s