This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gettimeofday resolution


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]