as Michael said, to gain on accuracy you need to use high performance timers or multimedia timers (Wiki: HPET
. The good news is that with both of them one can achieve a precise resolution of 1 ms. The bad news is that they are not implemented within the .Net Framework, so you have to import the functions/structures related to those timers and do the calculations yourself, but that is not that difficult
. Multimedia Timers
: Here you will find information about the multimedia timers. You will see a list of all structures and functions that you probably need to marshal in order to use them from a .Net environment. After you have understood this, you can try to parse the items yourself or search for it in the internet. High-Performance Timers
: Here you will find information about the high-performance timers. Even better, you will find here already an example, which includes the marshaling of the two needed functions and their use. Just a remark
, this document is intended for Windows-CE, but the functions and the way to handle with them is the same. The main different is the DLL in which the functions are included. The functions for Windows CE are included in the library "Coredll.dll"
, and for Windows Desktop are in "Kernel32.dll
I hope this information helps you to go forward with your project.