diff options
author | Artur <artur@vaadin.com> | 2018-05-07 09:42:18 +0300 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2018-05-07 09:42:18 +0300 |
commit | 3b904640cc56b6100d43a429aaedd462adcf46a1 (patch) | |
tree | 3b3c7cb7f7e27b35d2025c7f21c53c4cd39d4ab4 | |
parent | 1c53b2b7ed35be4a0a08aa0c2698e6a93c3b9b0c (diff) | |
download | vaadin-framework-3b904640cc56b6100d43a429aaedd462adcf46a1.tar.gz vaadin-framework-3b904640cc56b6100d43a429aaedd462adcf46a1.zip |
Restart debug log timer on first log row instead of immediately (#10640)
-rw-r--r-- | client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java b/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java index d8112f121b..0d67c46ce9 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java @@ -111,7 +111,7 @@ public final class VDebugWindow extends VOverlay { // Timers since application start, and last timer reset private static final Duration START = new Duration(); - private static Duration lastReset = START; + private static Duration lastReset = null; // outer panel protected FlowPanel window = new FlowPanel(); @@ -629,6 +629,10 @@ public final class VDebugWindow extends VOverlay { * @return */ static int getMillisSinceReset() { + if (lastReset == null) { + lastReset = new Duration(); + } + return lastReset.elapsedMillis(); } @@ -639,7 +643,7 @@ public final class VDebugWindow extends VOverlay { */ static int resetTimer() { int sinceLast = lastReset.elapsedMillis(); - lastReset = new Duration(); + lastReset = null; return sinceLast; } |