I've attached a proposal for a 'gettimeofday()' implementation that has better resolution than the current release. The current release version seems to have 15.625 ms resolution, which is the Windows clock interval. The attached version has a resolution of 1 µs on my machine.
Ticket moved from /p/mingw/patches/482/
Glenn Burkhardt's "gettimeofday.c" uses QueryPerformanceFrequency without checking if the return value is zero.
The QueryPerformanceFrequency function retrieves the frequency of the high-resolution performance counter, if one exists.
Parameters
lpFrequency
Points to a variable that the function sets, in counts per second, to the current performance-counter frequency. If the installed hardware does not support a high-resolution performance counter, this parameter can be to zero.
Return Values
If the installed hardware supports a high-resolution performance counter, the return value is nonzero.
If the installed hardware does not support a high-resolution performance counter, the return value is zero.