blob: 5dc0cfaf3f2cbac6c114589db07c174a0fa8482a (
plain)
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
|
#ifndef LLMR_UTIL_TIMER
#define LLMR_UTIL_TIMER
#include <llmr/platform/event.hpp>
#include <string>
namespace llmr {
namespace util {
#ifndef DISABLE_TIMER
class timer {
public:
timer(Event event = Event::General);
timer(EventSeverity severity, Event event = Event::General);
timer(const std::string &name, Event event = Event::General);
timer(const std::string &name, EventSeverity severity, Event event = Event::General);
void report(const std::string &name);
~timer();
private:
const std::string name;
EventSeverity severity = EventSeverity::Debug;
Event event = Event::General;
uint64_t start;
};
#else
class timer {
inline timer(Event event = Event::General);
inline timer(EventSeverity severity, Event event = Event::General);
inline timer(const std::string &name, Event event = Event::General);
inline timer(const std::string &name, EventSeverity severity, Event event = Event::General);
inline void report(const std::string &name) {}
inline ~timer() {}
};
#endif
}
}
#endif
|