[Haskell-cafe] getCPUTime ??
cgibbard at gmail.com
Mon Nov 21 16:26:17 EST 2005
getCPUTime gets the amount of CPU time used by the program so far, in
picoseconds (though with limited resolution). Use getClockTime from
System.Time to get the current clock time.
On 21/11/05, Michael Benfield <leftfist at mac.com> wrote:
> I'm new to Haskell. I'm apparently misunderstanding something here.
> When I run this program:
> module Main where
> import System.Posix
> import System.CPUTime
> printTime = getCPUTime >>= putStrLn . show
> main = printTime >> sleep 5 >> printTime
> It produces this output:
> or similar. In any case, both the numbers are the same. Should the
> second number not reflect a time 5 seconds later than the first? I've
> tried this with both GHC and Hugs, and both give me the same thing.
> Mike Benfield
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe