gettimeofday resolution
Greg Smith
gsmith@nc.rr.com
Thu Oct 11 15:31:00 GMT 2001
I couldn't help but notice that gettimeofday() returns the
same value for every 10ms time tick (times.cc is using
GetSystemTimeAsFileTime). One of our developers noted that
there are win32 functions QueryPerformanceFrequency and
QueryPerformanceCounter that can be used to gain microsecond
resolution at low cost.
(See http://msdn.microsoft.com/library/en-us/winui/timers_6mk9.asp
and http://msdn.microsoft.com/library/en-us/winui/timers_4z76.asp ).
These apparently reference a 64 bit counter called RDTSC present
in pentium class processors (and above). I am also told that
this is the method linux uses on intel to achieve microsecond
resolution.
I know, I know. I'll try to make it as few lines as possible ;-)
Greg
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list