Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is there a timer that has 1 millisec or better resolution?

resolution timer
0
Posted

Is there a timer that has 1 millisec or better resolution?

0

You can use the function XstGetDateAndTime as a simple timer but it is misleading to think that it can achieve nanosec resolutions. In using nanos in XstGetDateAndTime, Max was thinking ahead to a time when future processors can achieve such a thing. But as it stands now, this function at its best can only do 55 msecs between calls to itself. Listed below are the various results I got for various Win9x and XB timing functions while trying to time a 1 msec interval: XstGetDateAndTime 55 msec XstGetSystemTime 5 msec (which uses GetTickCount) GetTickCount 5 msec (kernel32.dll) timeGetTime 1 msec (winmm.dll) QueryPerformanceCounter 4 microsec (kernel32.dll) QueryPerformanceCounter which is found in kernel32.dll is used in conjunction with QueryPerformanceFrequency. These two functions are not currently in the XB kernel32.dec file so you would need to add them to that file in order to use them.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123