Getting milliseconds of current time precision in Qt
Timer resolution may vary on different platforms and readings may not be accurate. If you need to get an accurate high resolution timestamp on Windows 7, it provides the QPC API:
https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408%28v=vs.85%29.aspx
GetSystemTimePreciseAsFileTime
is claimed to provide system time with <1us resolution.
But this is only an exact time stamp. If you need to do something with 1ms latency (for example, handle an event), you need an RTOS, not a desktop handle.
source to share
One common way would be to magnify what you are doing and do it 10-100 times in a row, so you can get a more accurate time to read what you are doing by dividing the result by 10-100.
But getting millisecond accurate readings of your time is practically useless, because you don't have 100% of the processor time, which means that your readings will have much more variance than just 1 millisecond if the OS gives you a different process time while you are doing your actions. ...