event/Chrono: add type alias TimePoint
This commit is contained in:
parent
1b4fd74575
commit
d1957b83c8
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user