-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
timer: All configuration of granularity #367
Comments
One option would be to only set timeouts at 20ms granularity. In that case, the thread shouldn't have to wake up? Since everything is deadline based, it should be possible to ensure that timeouts get set in 20ms increments. Does something like this work? |
Would that ensure that timers are always at 20ms boundaries, i.e. the absolute difference between any two timers' "trigger times" is always an integer multiple of 20ms? Then that would work, yes |
Closing due to inactivity. |
See also |
Currently the timer granularity is always 1ms. It would be nice to be able to configure this, to be able to have a higher granularity < 1ms, or what is needed in my case, a lower one (e.g. 20ms).
My use-case is to batch process timers: everything that is to be emitted in those e.g. 20ms should be handled at once, instead of waking up the thread many times during those 20ms and cause more context switches, CPU usage and power consumption.
Alternatively, some API to schedule timers with a specific granularity (like e.g. in GLib
g_timeout_add_seconds
) would be nice. So that e.g. all timers that are scheduled with 20ms granularity will be triggered at the same time, all timers with 1s granularity at the same time, etc.The text was updated successfully, but these errors were encountered: