Here is a very simple demo on how to use the multimedia APIs to produce precision results in conjunction with the SleepEx() API. It has been tested on a machine that is almost at idle and it uses about 5% processor while running. The surprising thing was the SleepEx() API is a lot higher precision than I expected where the main lag was repeatedly retrieving the time from the OS. The winmm library has a number of functions that make this a far more reliable operation.
It would be expected that if the machine was subject to a heavy processor load that the precision would drop but tis will be the case with any other periodic process running on the machine.
[attachment deleted by admin]
Hutch,
I have found that I can get timing with better than 1 microsecond accuracy by taking the ratio of two functions from windows.h:
QueryPerformanceCounter( ) / QueryPerformanceFrequency( )
I base this conclusion on comparing its result against the cpu clock cycles sampled for the same period, on a cpu running at a known frequency.