PerformanceCounterFrequency fix.

Rein Klazes wijn at wanadoo.nl
Tue Jan 25 14:51:12 CST 2005


On Tue, 25 Jan 2005 19:30:04 +0100, you wrote:

> I'm quite certain that many programs use that function for extremely time critical code
> (games, anyone??), and that thus the Windows function is equally highly optimized,
> certainly much less slow than a gettimeofday() call.

> This should remain based on rdtsc IMHO, or on equally suitable and fast methods
> (ACPI counter, ...).

On my Windows machine (win2K) the calling sequence is
kernel32->ntdll->hal. In other words a switch to kernel mode with
associated overhead, similar to gettimeofday. I believe a program that
would be critically depending on this will use the rdtsc instruction
directly. 

Why do you believe otherwise?

> 
> Or did you actually test it with programs calling it a large number of times,
> or test its performance behaviour on Windows

I did not. On Linux gettimeofday() is fast enough to match the
resolution of the timer, approx. 1usec.

Rein.



More information about the wine-devel mailing list