Better double comparison.

GitOrigin-RevId: 5a7092ce72e7531835d57455a8027819a6f03ab5
This commit is contained in:
levlam 2018-02-20 03:03:28 +03:00
parent b676810b50
commit 4304fcfd89

View File

@ -46,8 +46,11 @@ class TimedStat {
StatT next_;
double next_timestamp_;
void update(double now) {
CHECK(now >= next_timestamp_);
void update(double &now) {
if (now < next_timestamp_) {
CHECK(now >= next_timestamp_ * (1 - 1e-14)) << now << " " << next_timestamp_;
now = next_timestamp_;
}
if (duration_ == 0) {
return;
}