Reputation: 11
Application has running ForegroundService. While this service is running it needs to execute some tasks every 5 seconds. It's important to measure time interval in elapsed system time.
All of them work in uptime and affected by cpu sleep. Official documentation recommends to use AlarmManager for time exact tasks, but for such short intervals it won't work and lead to "excessive wake up" warning. Keeping wakelock preventing cpu sleep will cause severe battery use by app.
So my question is: how to schedule task which will be executed in a short time interval (few seconds), where time is measured on elapsed time timeline?
Thanks in advance for your help.
Upvotes: 0
Views: 161
Reputation: 449
A very late response but maybe it will help to someone:
It depends on your goals but I think that one of the following must be in use to reach exact timing:
Upvotes: 0