diff options
Diffstat (limited to 'include/llmr/util/timer.hpp')
-rw-r--r-- | include/llmr/util/timer.hpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/include/llmr/util/timer.hpp b/include/llmr/util/timer.hpp index a1e8e05a9d..5dc0cfaf3f 100644 --- a/include/llmr/util/timer.hpp +++ b/include/llmr/util/timer.hpp @@ -1,6 +1,8 @@ #ifndef LLMR_UTIL_TIMER #define LLMR_UTIL_TIMER +#include <llmr/platform/event.hpp> + #include <string> namespace llmr { @@ -9,24 +11,29 @@ namespace util { #ifndef DISABLE_TIMER class timer { public: - timer(); - timer(const std::string &name); + 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() {} - inline timer(const std::string &name) {} - inline void report (const std::string &name) {} + 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 - } } |