~singpolyma/biboumi

cd92baae3f0de8b841b5bbfdb02e4fa95acd52c1 — louiz’ 6 years ago 6cb7787
Little refactor in timed_events

Also makes the coverage code deterministic
1 files changed, 2 insertions(+), 4 deletions(-)

M louloulibs/utils/timed_events.cpp
M louloulibs/utils/timed_events.cpp => louloulibs/utils/timed_events.cpp +2 -4
@@ 32,10 32,8 @@ bool TimedEvent::is_after(const std::chrono::steady_clock::time_point& time_poin

std::chrono::milliseconds TimedEvent::get_timeout() const
{
  auto now = std::chrono::steady_clock::now();
  if (now > this->time_point)
    return std::chrono::milliseconds(0);
  return std::chrono::duration_cast<std::chrono::milliseconds>(this->time_point - now);
  auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(this->time_point - std::chrono::steady_clock::now());
  return std::max(diff, 0ms);
}

void TimedEvent::execute() const