diff options
author | pacien | 2018-02-01 21:48:25 +0100 |
---|---|---|
committer | pacien | 2018-02-01 21:48:25 +0100 |
commit | 5664d1c145d7432f4052b0299af076d0630ecc8b (patch) | |
tree | 67e70394af7a4b4e1f249d6d0ec350fac1b5d28f /src/main/java/fr/umlv | |
parent | dedf2efd05faab7831c305e0a8553c22d2d7938f (diff) | |
download | wallj-5664d1c145d7432f4052b0299af076d0630ecc8b.tar.gz |
Add stopwatch
Signed-off-by: pacien <pacien.trangirard@pacien.net>
Diffstat (limited to 'src/main/java/fr/umlv')
-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 | } | ||