is g_get_current_time() sufficiently precise under Windows?



Hi -

While tracking-down some fun with measuring CPU utilization under Windows my "Windows guru" told me that while GetSystemTimeAsFileTime returns 100's of nanoseconds since the beginning of the Windows epoch, it is really only updated once per clock tick. Presently that is once every 10 ms.

From poking about under msdn.microsoft.com it seems that just about anything that returns clock time is limited to 10 ms precision, so I'm not entirely sure there is much to be done but I thought I should ask/mention since the online glib API docs don't seem to mention that limitation:

http://developer.gnome.org/doc/API/2.0/glib/glib-Date-and-Time-Functions.html#g-get-current-time

rick jones

Seems that GetSystemTimeAdjustment is involved in finding the precision of clock time:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getsystemtimeadjustment.asp

In glib's documentation's defence, the MSDN discussion of GetSystemTimeAsFileTime:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getsystemtimeadjustment.asp

doesn't discuss the limitation either



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]