It seems that it always return 0
or 15625000000
.
import System.CPUTime
main = do
print =<< getCPUTime
getLine
print =<< getCPUTime
getLine
return ()
Execution
>>time.exe
15625000000
15625000000
>>time.exe
0
0
>>time.exe
0
15625000000
>>time.exe
0
0
I'm on Windows, I think it's a platform related.
From hoogle
getCPUTime :: IO Integer
base System.CPUTime
Computation getCPUTime
returns the number of picoseconds CPU time used by the current program. The precision of this result is implementation-dependent.
It could be that windows doesn't have an accurate implementation and returns a 0 instead of the number of picoseconds, note i do not see this behavior on linux or osx.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With