diff options
Diffstat (limited to 'src/metrics.cc')
-rw-r--r-- | src/metrics.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/metrics.cc b/src/metrics.cc index fb44868..8407717 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 1000 * TimerToMicros(HighResTimer()); +} + |