QueryPerformanceCounter - who knew?

There IS such a thing as a high-performance timer in Windows. You need an API call to use it - but it exists.

Using the "Time" or "Now" functions gets you time to the second because the routine intentionally rounds it. Using the "Timer" function, you can get something as "milliseconds since midnight" but that timer ticks in 1/60th of a second in the USA. (Other venues - 50th of a second.) The API-based precision timer can do much faster ticks, down to microseconds as a viable unit. However, the machine instructions to get that timer add a slight constant bias since on CPUs with a slower clock, instruction times are commensurate with the internal crystal clock ticks.
 
The timer intervals depend on the system clock which is hardware dependant rather than location dependant.
Normally updated 64 times per second. Certainly nothing to do with AC mains frequency in each country

There are several methods of measuring time intervals to millisecond intervals and the high resolution timer method allows you to measure to 0.1 microseconds. But precision and accuracy do not necessarily correlate.

I have tried many different methods of timing in my various speed comparison tests and some time ago wrote an article discussing the various approaches
 
The timer intervals depend on the system clock which is hardware dependant rather than location dependant.
Normally updated 64 times per second. Certainly nothing to do with AC mains frequency in each country

There are several methods of measuring time intervals to millisecond intervals and the high resolution timer method allows you to measure to 0.1 microseconds. But precision and accuracy do not necessarily correlate.

I have tried many different methods of timing in my various speed comparison tests and some time ago wrote an article discussing the various approaches
Very impressive article Colin, don't know how I missed it...
 
Thanks. Haven't yet watched Daniel's video.
Does he cover any additional methods I haven't included?
 
Thanks. Haven't yet watched Daniel's video.
Does he cover any additional methods I haven't included?
No sir. TBT, your article is more comprehensive. He does show some examples on how to incorporate his methods, including a Class Module (cool points)
 
Normally updated 64 times per second. Certainly nothing to do with AC mains frequency in each country

Technically, also depends on the age of the computer, and YES, the older machines DID depend on the wall current frequency.
 
UK is 50Hz AC but the system clock updates 64 times per second.
AFAIK that frequency still applies even in the latest PCs

Define older in this context. And what is the 'wall' current frequency?
 
Daniel's videos (and his website) are very informative and well done. I know he is not too happy with M$oft at the moment. I think it's great for the rest of us that he is providing a lot of his experiences and practices via youtube videos.
 

Users who are viewing this thread

Back
Top Bottom