From d1957b83c8a6cd8120567a99feeaabc75cf76cc7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 5 Feb 2021 13:05:00 +0100 Subject: [PATCH] event/Chrono: add type alias TimePoint --- src/event/Chrono.hxx | 1 + src/event/FineTimerEvent.hxx | 2 +- src/event/TimerList.cxx | 2 +- src/event/TimerList.hxx | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/event/Chrono.hxx b/src/event/Chrono.hxx index f4f005d60..85f1f4c26 100644 --- a/src/event/Chrono.hxx +++ b/src/event/Chrono.hxx @@ -30,6 +30,7 @@ namespace Event { using Clock = std::chrono::steady_clock; using Duration = Clock::duration; +using TimePoint = Clock::time_point; } // namespace Event diff --git a/src/event/FineTimerEvent.hxx b/src/event/FineTimerEvent.hxx index 57fd88586..e4639deda 100644 --- a/src/event/FineTimerEvent.hxx +++ b/src/event/FineTimerEvent.hxx @@ -64,7 +64,7 @@ class FineTimerEvent final * When is this timer due? This is only valid if IsPending() * returns true. */ - Event::Clock::time_point due; + Event::TimePoint due; public: FineTimerEvent(EventLoop &_loop, Callback _callback) noexcept diff --git a/src/event/TimerList.cxx b/src/event/TimerList.cxx index ae305c9b6..d2f3bef8d 100644 --- a/src/event/TimerList.cxx +++ b/src/event/TimerList.cxx @@ -54,7 +54,7 @@ TimerList::Insert(FineTimerEvent &t) noexcept } Event::Duration -TimerList::Run(const Event::Clock::time_point now) noexcept +TimerList::Run(const Event::TimePoint now) noexcept { while (true) { auto i = timers.begin(); diff --git a/src/event/TimerList.hxx b/src/event/TimerList.hxx index 0a8fed7f7..36b97f101 100644 --- a/src/event/TimerList.hxx +++ b/src/event/TimerList.hxx @@ -71,5 +71,5 @@ public: * duration until the next timer expires. Returns a negative * duration if there is no timeout. */ - Event::Duration Run(Event::Clock::time_point now) noexcept; + Event::Duration Run(Event::TimePoint now) noexcept; };