-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuTimer.hpp
More file actions
37 lines (27 loc) · 737 Bytes
/
Copy pathuTimer.hpp
File metadata and controls
37 lines (27 loc) · 737 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
35
36
37
/**
* \file uTimer.hpp
* \brief Header file for UTimer class
* \author Luca Di Mauro
*/
#ifndef U_TIMER_HPP
#define U_TIMER_HPP
#include <iostream>
#include <chrono>
#include <mutex>
/* Class which allows to keep track of elapsed time between creation of an object instance of this class and its destruction,
* printing out a message registered during creation of object
*/
class UTimer {
private:
using usecs = std::chrono::microseconds;
using msecs = std::chrono::milliseconds;
using TimePoint = std::chrono::system_clock::time_point;
TimePoint start;
TimePoint stop;
std::chrono::duration<double> elapsedTime;
std::string message;
public:
UTimer (const std::string m);
~UTimer ();
};
#endif // U_TIMER_HPP