-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClientTimer.h
More file actions
34 lines (28 loc) · 728 Bytes
/
ClientTimer.h
File metadata and controls
34 lines (28 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef __CLIENT_TIMER_H__
#define __CLIENT_TIMER_H__
#include <chrono>
using namespace std::chrono;
class ClientTimer {
public:
duration<double, std::micro> sum;
duration<double, std::micro> max;
duration<double, std::micro> min;
int op_count;
time_point<std::chrono::high_resolution_clock> start_time;
duration<double, std::micro> elapsed_time;
ClientTimer();
void operator = (const ClientTimer &timer) {
sum = timer.sum;
max = timer.max;
min = timer.min;
op_count = timer.op_count;
start_time = timer.start_time;
elapsed_time = timer.elapsed_time;
}
void Start();
void End();
void EndAndMerge();
void Merge(ClientTimer timer);
void PrintStats();
};
#endif // end of #ifndef __CLIENT_TIMER_H__