[Haskell-cafe] Re: Computer time, independent of date

Mauricio briqueabraque at yahoo.com
Fri Jan 9 15:32:14 EST 2009

>> Linux has High-Resolution Timers (HRTs) that may be appropriate.  See
>> the manpage for clock_gettime(), which defines these HRTs:
>> [...]
>> CLOCK_MONOTONIC, in particular, looks suitable.  Using it could be a
>> matter of just a few quick likes in FFI.
>> I don't know if Windows has similar features.
> http://msdn.microsoft.com/en-us/library/ms632592(VS.85).aspx
> and QueryPerformanceCounter, in detail.

Going from GetProcessTimes, which I found in ghc code
in libraries/base/System/CPUTime.hsc, I was just able
to find this in that same site:


Seems simpler. Since linux (and unix?) have clock_gettime
and windows has this GetTickCount, maybe it could be possible
to add getSystemCPUTime to System.CPUTime.


More information about the Haskell-Cafe mailing list