From bbcccb84dd87ae253cb60529b47c5be8dca77b86 Mon Sep 17 00:00:00 2001 From: Bruno Salmon Date: Tue, 7 Nov 2023 08:58:57 +0000 Subject: [PATCH] Removed debug logs from UiSchedulerProviderBase --- .../uischeduler/spi/impl/UiSchedulerProviderBase.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/webfx-platform-uischeduler/src/main/java/dev/webfx/platform/uischeduler/spi/impl/UiSchedulerProviderBase.java b/webfx-platform-uischeduler/src/main/java/dev/webfx/platform/uischeduler/spi/impl/UiSchedulerProviderBase.java index 66915c75..5a8341d6 100644 --- a/webfx-platform-uischeduler/src/main/java/dev/webfx/platform/uischeduler/spi/impl/UiSchedulerProviderBase.java +++ b/webfx-platform-uischeduler/src/main/java/dev/webfx/platform/uischeduler/spi/impl/UiSchedulerProviderBase.java @@ -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; } } @@ -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) {