summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-10-28 12:47:58 -0400
committerKonstantin Käfer <mail@kkaefer.com>2014-10-28 12:47:58 -0400
commitdbddd3c904d34eecdda4bb7d1d0dc30c4ea7e13b (patch)
treec3f40984bd0ec4cf136ad90de871b5e87a55062b /src/util
parent602b9da9928e10b55489d2a5c9599107b32dc90a (diff)
downloadqtlocation-mapboxgl-dbddd3c904d34eecdda4bb7d1d0dc30c4ea7e13b.tar.gz
gyp fixes
Diffstat (limited to 'src/util')
-rw-r--r--src/util/stopwatch.cpp (renamed from src/util/timer.cpp)16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/util/timer.cpp b/src/util/stopwatch.cpp
index 5c4af51da4..c9b8756e3b 100644
--- a/src/util/timer.cpp
+++ b/src/util/stopwatch.cpp
@@ -1,5 +1,5 @@
-#ifndef DISABLE_TIMER
-#include <mbgl/util/timer.hpp>
+#ifndef DISABLE_STOPWATCH
+#include <mbgl/util/stopwatch.hpp>
#include <mbgl/util/time.hpp>
#include <mbgl/platform/log.hpp>
@@ -8,26 +8,26 @@
using namespace mbgl::util;
-timer::timer(Event event_)
+stopwatch::stopwatch(Event event_)
: event(event_), start(now()) {}
-timer::timer(EventSeverity severity_, Event event_)
+stopwatch::stopwatch(EventSeverity severity_, Event event_)
: severity(severity_), event(event_), start(now()) {}
-timer::timer(const std::string &name_, Event event_)
+stopwatch::stopwatch(const std::string &name_, Event event_)
: name(name_), event(event_), start(now()) {}
-timer::timer(const std::string &name_, EventSeverity severity_, Event event_)
+stopwatch::stopwatch(const std::string &name_, EventSeverity severity_, Event event_)
: name(name_), severity(severity_), event(event_), start(now()) {}
-void timer::report(const std::string &name_) {
+void stopwatch::report(const std::string &name_) {
timestamp duration = now() - start;
Log::Record(severity, event, name_ + ": " + std::to_string((double)(duration) / 1_millisecond) + "ms");
start += duration;
}
-timer::~timer() {
+stopwatch::~stopwatch() {
if (name.size()) {
report(name);
}