[Vm-dev] Fwd: [Pharo-project] System time

Levente Uzonyi leves at elte.hu
Wed May 4 02:10:43 UTC 2011


On Tue, 3 May 2011, Eliot Miranda wrote:

> Its because on linux & mac the clock is derived from gettimeofday which is
> wall time but on Windows it is derived from timeGetTime which isn't. The 
> problem is the lack of a high-resolution wall time on Windows. 
> GetSystemTimeAsFileTime et al have something like 16 ms resolution whereas 
> timeGetTime has 1ms resolution.

On vista the accuracy of GetLocalTime (which is a "friend" of
GetSystemTimeAsFileTime) seems to be 1ms. E.g.:

s := Set new.
[ s size < 10 ] whileTrue: [ s add: Win32SystemTime localDateAndTime ].
s sorted

Output:
  {2011-05-04T04:03:40.049+02:00 . 2011-05-04T04:03:40.05+02:00 . 
2011-05-04T04:03:40.051+02:00 . 2011-05-04T04:03:40.052+02:00 . 
2011-05-04T04:03:40.053+02:00 . 2011-05-04T04:03:40.054+02:00 . 
2011-05-04T04:03:40.055+02:00 . 2011-05-04T04:03:40.056+02:00 . 
2011-05-04T04:03:40.057+02:00 . 2011-05-04T04:03:40.058+02:00}


Levente


More information about the Vm-dev mailing list