Add typedefs for std::chrono::steady_clock types

This commit is contained in:
John Firebaugh
2015-04-01 14:05:37 -07:00
committed by Konstantin Käfer
parent 440864063e
commit 9331acf8e6
34 changed files with 203 additions and 182 deletions

View File

@@ -9,19 +9,19 @@
using namespace mbgl::util;
stopwatch::stopwatch(Event event_)
: event(event_), start(std::chrono::steady_clock::now()) {}
: event(event_), start(Clock::now()) {}
stopwatch::stopwatch(EventSeverity severity_, Event event_)
: severity(severity_), event(event_), start(std::chrono::steady_clock::now()) {}
: severity(severity_), event(event_), start(Clock::now()) {}
stopwatch::stopwatch(const std::string &name_, Event event_)
: name(name_), event(event_), start(std::chrono::steady_clock::now()) {}
: name(name_), event(event_), start(Clock::now()) {}
stopwatch::stopwatch(const std::string &name_, EventSeverity severity_, Event event_)
: name(name_), severity(severity_), event(event_), start(std::chrono::steady_clock::now()) {}
: name(name_), severity(severity_), event(event_), start(Clock::now()) {}
void stopwatch::report(const std::string &name_) {
std::chrono::steady_clock::duration duration = std::chrono::steady_clock::now() - start;
Duration duration = Clock::now() - start;
Log::Record(severity, event, name_ + ": " + util::toString(std::chrono::duration_cast<std::chrono::milliseconds>(duration).count()) + "ms");
start += duration;