'Do timers on Android have tolerance?

On iOS, most, if not all of the mechanisms for scheduling delayed work allow you to specify a "tolerance".

Examples:

https://developer.apple.com/documentation/foundation/timer https://developer.apple.com/documentation/dispatch/dispatchqueue/3329231-schedule

If you are not familiar with the concept, tolerance allows the operating system to deliberately fire a timer later than the scheduled target time. This lets the operating system move nearby timers around to cluster them together, so the CPU can spend more time sleeping, and conserve power. Many timers on iOS actually have a default tolerance of 10%, so if you schedule a callback after 30 seconds, it will often fire at 33 seconds instead!

Windows has this too, Microsoft have quite a good doc about it:

I've looked and googled for an equivalent on Android - but as far as I can tell there isn't any such thing? None of the timer related methods on the Google developer docs site seem to mention tolerance, leeway, or any other similar term.

Am I missing something? Are there timers with tolerance on Android, or does this simply not exist?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source