diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-07-16 18:53:56 -0700 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-07-16 18:53:56 -0700 |
commit | 4ea281c750c5afcc68f2832bb42d98a1cbce6735 (patch) | |
tree | 60bc7d3ccba2c54859e2e023997cc027cc67aea7 /include/mbgl/util/timer.hpp | |
parent | c1a64dc5fa73b54cc5de77629781dfc74302a1e7 (diff) | |
download | qtlocation-mapboxgl-4ea281c750c5afcc68f2832bb42d98a1cbce6735.tar.gz |
rename llmr => mbgl
Diffstat (limited to 'include/mbgl/util/timer.hpp')
-rw-r--r-- | include/mbgl/util/timer.hpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/mbgl/util/timer.hpp b/include/mbgl/util/timer.hpp new file mode 100644 index 0000000000..8171c2f5d1 --- /dev/null +++ b/include/mbgl/util/timer.hpp @@ -0,0 +1,40 @@ +#ifndef MBGL_UTIL_TIMER +#define MBGL_UTIL_TIMER + +#include <mbgl/platform/event.hpp> + +#include <string> + +namespace mbgl { +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 |