diff options
Diffstat (limited to 'src/metrics.h')
-rw-r--r-- | src/metrics.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/metrics.h b/src/metrics.h index 044011d..b6da859 100644 --- a/src/metrics.h +++ b/src/metrics.h @@ -64,16 +64,18 @@ int64_t GetTimeMillis(); /// A simple stopwatch which returns the time /// in seconds since Restart() was called. -class Stopwatch { +struct Stopwatch { public: Stopwatch() : started_(0) {} /// Seconds since Restart() call. - double Elapsed() const { return 1e-6 * static_cast<double>(Now() - started_); } + double Elapsed() const { + return 1e-6 * static_cast<double>(Now() - started_); + } void Restart() { started_ = Now(); } -private: + private: uint64_t started_; uint64_t Now() const; }; |