aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/fr/umlv/java/wallj/viewer/Viewer.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/fr/umlv/java/wallj/viewer/Viewer.java b/src/main/java/fr/umlv/java/wallj/viewer/Viewer.java
index 6b4f5c4..5a7d869 100644
--- a/src/main/java/fr/umlv/java/wallj/viewer/Viewer.java
+++ b/src/main/java/fr/umlv/java/wallj/viewer/Viewer.java
@@ -47,12 +47,13 @@ public final class Viewer {
47 events.clear(); 47 events.clear();
48 events.addAll(newEvents); //add the new events returned by updates 48 events.addAll(newEvents); //add the new events returned by updates
49 }); 49 });
50 lastExecDuration = FRAME_DURATION.minus(stopWatch.peek());
51 try { 50 try {
52 if (!lastExecDuration.isNegative()) Thread.sleep(lastExecDuration.toMillis()); 51 Duration sleepDuration = FRAME_DURATION.minus(stopWatch.peek());
52 if (!sleepDuration.isNegative()) Thread.sleep(sleepDuration.toMillis());
53 } catch (Exception e) { 53 } catch (Exception e) {
54 applicationContext.exit(-1); 54 applicationContext.exit(-1);
55 } 55 }
56 lastExecDuration = stopWatch.peek();
56 } 57 }
57 applicationContext.exit(0); 58 applicationContext.exit(0);
58 } 59 }