Hello, the default behaviour (at least on my W2K box) of system time is that it gets updated every 100 msecs by 100 msecs (the system may use system time adjustment to update system time, but it is free to use another techniques). For more info see GetSystemTimeAdjustment in Win32 API Help (such as Platform SDK documentation). Those folks should have called GetSystemTimeAdjustment also or (and) use high resolution timer (QueryPerformanceFrequency, QueryPerformanceCounter). At least, things are not that easy and transparent as on POSIX box, are they ? Ondrej Krajicek PS: Here are the results of similar program (written in Delphi) from by box: System Time Adjustment: time adjustment (nsec) = 100144 time increment (nsec) = 100144 Tick Count: start tick count = 2117384 sleep 100 msec stop tick count = 2117484 delta = 100 --------------------------------------------------------------------- Ondrej [Krajicek at ics.muni.cz] OK-) fi: xkrajic at fi.muni.cz .Omnia ad maiorem Informaticae gloriam -->>> The Nexus Framework <<<-- sourceforge.net/projects/nexusproject .Of course we can, moreover we must, it is our holiest duty --------------------------------------------------------------------- Les Schaffer wrote: > > i am talking to some hardware, needing to resolve 10's-100's of msec > of time. So I started playing around with the clock and GetTickCount > functions under win32 to check for finer time resolution. > > See code below. timimg results for win2k at: > > http://folks.astrian.net/godzilla/ticks.html > > GetTickCount has some funniness in its behavior. > > i'm good and stickin with clock for now. But I am curious to hear > other people's observations about msec time resolution or possibly > even smaller, particularly on winXX and linux. > > les 'time-has-come-tudayyy' schaffer > > ========================= > > from time import clock, sleep > from win32api import GetTickCount > > def _yawn( sec ): > now = clock() > while (clock() - now) < sec: pass > > > div = '\n========\n' > def testTick( sleepyTimeTime ): > print div, 'SleepyTimeTime = ', sleepyTimeTime*1000, div, > for i in (0,1,2): > x = clock() > _yawn(sleepyTimeTime) > y = clock() > print 'delta(clock) = ', (y-x)*1000 > x = GetTickCount() > _yawn(sleepyTimeTime) > y = GetTickCount() > print 'delta(GetTickCount) = ', y - x > > print div > > testTick(0.0001) > testTick(0.001) > testTick(0.01) > testTick(0.1) > testTick(1) --
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4