Fix util::timer: add timer duration to tracked time point instead of replacing it with now()
This commit is contained in:
parent
d369abc61b
commit
460632a118
2 changed files with 2 additions and 2 deletions
|
|
@ -42,7 +42,7 @@ namespace psemek::util
|
||||||
return duration().count();
|
return duration().count();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
time_point_type start_;
|
time_point_type start_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace psemek::util
|
||||||
{
|
{
|
||||||
if (this->duration() >= duration_)
|
if (this->duration() >= duration_)
|
||||||
{
|
{
|
||||||
this->restart();
|
this->start_ += std::chrono::duration_cast<typename Clock::duration>(duration_);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue