aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/fr/umlv/java/wallj/viewer/StopWatch.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/fr/umlv/java/wallj/viewer/StopWatch.java b/src/main/java/fr/umlv/java/wallj/viewer/StopWatch.java
new file mode 100644
index 0000000..55f0440
--- /dev/null
+++ b/src/main/java/fr/umlv/java/wallj/viewer/StopWatch.java
@@ -0,0 +1,16 @@
1package fr.umlv.java.wallj.viewer;
2
3import java.time.Duration;
4
5/**
6 * A stopwatch that reports the elapsed time since its creation.
7 *
8 * @author Pacien TRAN-GIRARD
9 */
10public class StopWatch {
11 private long startTime = System.currentTimeMillis();
12
13 public Duration peek() {
14 return Duration.ofMillis(System.currentTimeMillis() - startTime);
15 }
16}