diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/fr/umlv/java/wallj/viewer/StopWatch.java | 16 |
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 @@ | |||
1 | package fr.umlv.java.wallj.viewer; | ||
2 | |||
3 | import java.time.Duration; | ||
4 | |||
5 | /** | ||
6 | * A stopwatch that reports the elapsed time since its creation. | ||
7 | * | ||
8 | * @author Pacien TRAN-GIRARD | ||
9 | */ | ||
10 | public class StopWatch { | ||
11 | private long startTime = System.currentTimeMillis(); | ||
12 | |||
13 | public Duration peek() { | ||
14 | return Duration.ofMillis(System.currentTimeMillis() - startTime); | ||
15 | } | ||
16 | } | ||