Skip to content

Commit

Permalink
Removed debug logs from UiSchedulerProviderBase
Browse files Browse the repository at this point in the history
  • Loading branch information
salmonb committed Nov 7, 2023
1 parent aa183e2 commit bbcccb8
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,11 @@ private boolean shouldExecuteNow() {
}

private void execute() {
long nowMillis = System.currentTimeMillis();
if (nextExecutionTimeMillis > 0 && nowMillis > nextExecutionTimeMillis + 16)
log("🥵 Late by " + (nowMillis - nextExecutionTimeMillis) + "ms");
wrappedRunnable.run();
if (nextExecutionTimeMillis != 0 && wrappedRunnable.isPeriodic()) {
nextExecutionTimeMillis += delayMs;
long nowMillis = System.currentTimeMillis();
if (nextExecutionTimeMillis < nowMillis) {
log("🤷");
nextExecutionTimeMillis = nowMillis + delayMs;
}
}
Expand Down Expand Up @@ -209,7 +206,7 @@ protected void scheduleNextAnimationExecution(boolean stop, boolean reset, long
protected Scheduled scheduleLongTermAnimation(long delayMillis, Runnable runnable) {
// This default implementation assumes Scheduler.scheduleDelay() has its own independent implementation (so it
// doesn't loop back to this UiScheduler). If not, it needs to be overridden.
return Scheduler.scheduleDelay(delayMillis, runnable);
return Scheduler.scheduleDelay(delayMillis, () -> runInUiThread(runnable));
}

protected void log(String message) {
Expand Down

0 comments on commit bbcccb8

Please sign in to comment.