Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Callbacks and Timers » TimerCallBack interval resolution
Re: TimerCallBack interval resolution [message #58036 is a reply to message #58030] Sat, 22 January 2022 19:32 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
deep wrote on Fri, 21 January 2022 07:39
Hi Didier,

My issue is not about time profiling.

I am looking at time interval and repeatability of time interval.

When I set TimerCallback time value between -22 to -39 ms. I get interval of 40 ms.
Depending on value of time I set I get time interval in multiple of 20 ms.

If I want 30 ms. time interval for timercallback I am not getting it. I get greater time interval - multiple time interval of 20 ms.


Interval repeatability is 1ms. which is okay for me.


It is supposed to be about 20ms by design and it is not even guaranteed. If you need more precise timing, you need to run it in separate thread.

More details: GUI timer is run each time after the set of GUI events is processed and queue becomes empty. Those 20ms actually apply for the case that there are no events - if there are no event for 20 ms, timer is invoked. That also means if the GUI event (e.g. keystroke) takes more than 20ms to process, the interval can be actually much bigger than 20ms.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to do to stop progress zip file ?
Goto Forum:
  


Current Time: Fri Aug 29 14:13:14 CEST 2025

Total time taken to generate the page: 0.04635 seconds