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