summaryrefslogtreecommitdiffstats
path: root/src/metrics.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/metrics.cc')
-rw-r--r--src/metrics.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/metrics.cc b/src/metrics.cc
index fb44868..ca4f97a 100644
--- a/src/metrics.cc
+++ b/src/metrics.cc
@@ -72,6 +72,7 @@ int64_t TimerToMicros(int64_t dt) {
} // anonymous namespace
+
ScopedMetric::ScopedMetric(Metric* metric) {
metric_ = metric;
if (!metric_)
@@ -113,3 +114,12 @@ void Metrics::Report() {
metric->count, avg, total);
}
}
+
+uint64_t Stopwatch::Now() const {
+ return TimerToMicros(HighResTimer());
+}
+
+int64_t GetTimeMillis() {
+ return TimerToMicros(HighResTimer()) / 1000;
+}
+