Commit d1957b83 authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

event/Chrono: add type alias TimePoint

parent 1b4fd745
......@@ -30,6 +30,7 @@ namespace Event {
using Clock = std::chrono::steady_clock;
using Duration = Clock::duration;
using TimePoint = Clock::time_point;
} // namespace Event
......
......@@ -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
......
......@@ -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();
......
......@@ -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;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment