View Full Version : QTimer Time Resolution

1st July 2011, 08:02
Can u set the QTimer Time Resolution to be less then milisecond . Also can the interval value would be in double float etc

1st July 2011, 08:43
No and No.

If you want accuracy of less than a millisecond, you need platform specific functions.

What are you trying to do?

1st July 2011, 09:02
So suppose i have choosen a variable of double for timeinterval and may be value less then 1 milisec lets take .2 so in this case the next timerevent will fire after completion of 1 milisec
in this case there will 5 complete interval but timer event is called only after 1 mili sec or 5 times in amili sec

1st July 2011, 14:17
so in this case the next timerevent will fire after completion of 1 milisec
It will fire as the doc states:

A QTimer with a timeout interval of 0 will time out as soon as all the events in the window system's event queue have been processed.
Which can be any interval.

In addition, saying that the QTimer will fire with 1 ms resolution is also not 100% correct.
QTimer takes interval values in 1 ms resolution.
The actual interval might, and usually does vary, depending on the current system and its state.
Under windows, having a less than 1 ms timer resolution is probably not really practical/possible - I know wysota will laugh at the notion alone.
You might find this interesting:
And if you are on windows: