Use the std::chrono to get the time.
[ Merge of http://go/wvgerrit/67985 ] Now that we can use C++11, we should use the cross-platform types for clocks instead of the platform-specific versions. Test: WV unit/integration tests. Change-Id: I50318e3d1caf9e814f33f497f83c19c9f3c154a1
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifndef WVCDM_METRICS_TIMER_METRIC_H_
|
||||
#define WVCDM_METRICS_TIMER_METRIC_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <chrono>
|
||||
|
||||
namespace wvcdm {
|
||||
namespace metrics {
|
||||
@@ -23,8 +23,8 @@ class TimerMetric {
|
||||
double AsUs() const;
|
||||
|
||||
private:
|
||||
double sec_;
|
||||
double usec_;
|
||||
std::chrono::steady_clock clock_;
|
||||
std::chrono::time_point<std::chrono::steady_clock> start_;
|
||||
bool is_started_;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user