-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTimeUnivChronoSimple.h
44 lines (36 loc) · 1.14 KB
/
TimeUnivChronoSimple.h
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
35
36
37
38
39
40
41
42
43
44
#ifndef TIMEUNIVCHRONOSIMPLE_H
#define TIMEUNIVCHRONOSIMPLE_H
using namespace std;
class UnivTime{
public:
unsigned long long int nanosecs;
unsigned long long int milliseconds;
unsigned long long int secs;
unsigned long long int mins;
unsigned long long int hours;
unsigned long long int days;
unsigned long long int years;
unsigned long long int centuries;
char chronoType; // 'N'=nanosec,'M'= milisec,'S' =sec
void fromSec(unsigned long long int timeSec);
void fromMilliSec(unsigned long long int timeMilliSec);
void fromNanoSec(unsigned long long int timeNanoSec);
UnivTime(unsigned long long int time,char timeUnit);
string getString();
void print();
void printCompleteMessageExecTime();
};
// chrono simplifying class
typedef chrono::high_resolution_clock::time_point timePoint;
class ChronoSimple{
private:
timePoint _start;
timePoint _stop;
public:
unsigned long long int stopNanoSec(); // 'N' for nanosec 'M' for milisec and 'S' for sec
unsigned long long int stopMilliSec();
unsigned long long int stopSec();
void start();
//ChronoSimple();
};
#endif