diff options
author | Stiver <stiver.mail@gmail.com> | 2014-03-04 15:13:11 +0100 |
---|---|---|
committer | Stiver <stiver.mail@gmail.com> | 2014-03-04 15:13:11 +0100 |
commit | e2d0f5d9c38561d67f23754c00addb4a3547efb2 (patch) | |
tree | 1832f16037c086b48266b8566aecc61f45f4e5f1 /src/test/util/Timer.java | |
download | fernflower-e2d0f5d9c38561d67f23754c00addb4a3547efb2.tar fernflower-e2d0f5d9c38561d67f23754c00addb4a3547efb2.tar.gz fernflower-e2d0f5d9c38561d67f23754c00addb4a3547efb2.tar.lz fernflower-e2d0f5d9c38561d67f23754c00addb4a3547efb2.tar.xz fernflower-e2d0f5d9c38561d67f23754c00addb4a3547efb2.zip |
initial commit
Diffstat (limited to 'src/test/util/Timer.java')
-rw-r--r-- | src/test/util/Timer.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/test/util/Timer.java b/src/test/util/Timer.java new file mode 100644 index 0000000..5a45cc0 --- /dev/null +++ b/src/test/util/Timer.java @@ -0,0 +1,31 @@ +package test.util; + +import java.util.HashMap; + +public class Timer { + + private static HashMap<String, Double> mapValue = new HashMap<String, Double>(); + + public static void addTime(int index, long value) { + addTime(String.valueOf(index), value); + } + + public static double getTime(int index) { + return mapValue.get(String.valueOf(index)); + } + + public static void addTime(String index, double value) { + Double val = mapValue.get(index); + if(val != null) { + value+=val.doubleValue(); + } + mapValue.put(index, value); + } + + public static double getTime(String index) { + Double value = mapValue.get(index); + return value==null?0:value.doubleValue(); + } + +} + |