mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 22:51:02 +00:00
Duty/cycle improvement
This commit is contained in:
parent
826c67700e
commit
ae8c33be45
1 changed files with 3 additions and 1 deletions
|
@ -60,12 +60,14 @@ public class DutyCycle {
|
||||||
if (busy + idle > interval) {
|
if (busy + idle > interval) {
|
||||||
long wait = (duration - idle);
|
long wait = (duration - idle);
|
||||||
Log.i(name + " busy=" + busy + " idle=" + idle + " wait=" + wait);
|
Log.i(name + " busy=" + busy + " idle=" + idle + " wait=" + wait);
|
||||||
if (wait > 0)
|
if (wait > 0) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(wait);
|
Thread.sleep(wait);
|
||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
Log.w(ex);
|
Log.w(ex);
|
||||||
}
|
}
|
||||||
|
last += wait;
|
||||||
|
}
|
||||||
idle = 0;
|
idle = 0;
|
||||||
busy = 0;
|
busy = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue