gettimeofday - millisecond accuracy

fred zfred@bigpond.com
Fri Dec 19 04:01:00 GMT 2008


with my test of gettimeofday in cygwin it appears to be counting in 
milliseconds
rather than microseconds.

so I had a look at where it is coded, /winsup/cygwin/times.cc

...
gettimeofday (struct timeval *tv, void *tzvp)
{
  struct timezone *tz = (struct timezone *) tzvp;
  static bool tzflag;
  LONGLONG now = gtod.usecs ();
...

I notice there is
hires_ms NO_COPY gtod;


however lower down there is appears to be a hires_us
class coded.

So I am wondering what the story is behind this ?

I will look at testing some changes here and testing, just need to do a 
successful build from source
of as is first.....

I am looking for microsecond resolution, and see that hires_us is using 
QueryPerformanceFrequency/QueryPerformanceCounter,
so thats looking good I think?

I have code that does bitbanging to the parallel  port, it works 
perfectly under linux,  and would like
to see it work in cygwin also.

Thanks
 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list