Files
android/libwvdrmengine/cdm/metrics/src/timer_metric.cpp
Rahul Frias 25d29fd22b 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
2018-12-13 12:09:04 -08:00

25 lines
448 B
C++

#include "timer_metric.h"
namespace wvcdm {
namespace metrics {
void TimerMetric::Start() {
start_ = clock_.now();
is_started_ = true;
}
void TimerMetric::Clear() {
is_started_ = false;
}
double TimerMetric::AsMs() const {
return (clock_.now() - start_) / std::chrono::milliseconds(1);
}
double TimerMetric::AsUs() const {
return (clock_.now() - start_) / std::chrono::microseconds(1);
}
} // namespace metrics
} // namespace wvcdm