Changes
[iotcloud.git] / version2 / src / java / iotcloud / TimingSingleton.java
1 package iotcloud;
2
3
4 class TimingSingleton {
5     private static TimingSingleton singleton = new TimingSingleton( );
6     private static long startTime = 0;
7
8     private static long totalTime = 0;
9
10     private TimingSingleton() {
11
12     }
13
14     public static TimingSingleton getInstance( ) {
15         return singleton;
16     }
17
18
19     public static void startTime( ) {
20         startTime = System.nanoTime();
21     }
22
23     public static void endTime( ) {
24         totalTime += System.nanoTime() - startTime;
25
26     }
27
28     public static long getTime( ) {
29         return totalTime;
30     }
31
32
33 }