diff options
Diffstat (limited to 'simpleperf/IOEventLoop.h')
-rw-r--r-- | simpleperf/IOEventLoop.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/simpleperf/IOEventLoop.h b/simpleperf/IOEventLoop.h index 1578a4d0..cc5c9bfd 100644 --- a/simpleperf/IOEventLoop.h +++ b/simpleperf/IOEventLoop.h @@ -46,9 +46,6 @@ class IOEventLoop { IOEventLoop(); ~IOEventLoop(); - // Use precise timer for periodic events which want precision in ms. - bool UsePreciseTimer(); - // Register a read Event, so [callback] is called when [fd] can be read // without blocking. If registered successfully, return the reference // to control the Event, otherwise return nullptr. @@ -74,6 +71,10 @@ class IOEventLoop { IOEventRef AddPeriodicEvent(timeval duration, const std::function<bool()>& callback, IOEventPriority priority = IOEventLowPriority); + // Register a one time Event, so [callback] is called once after [duration]. + IOEventRef AddOneTimeEvent(timeval duration, const std::function<bool()>& callback, + IOEventPriority priority = IOEventLowPriority); + // Run a loop polling for Events. It only exits when ExitLoop() is called // in a callback function of registered Events. bool RunLoop(); @@ -99,7 +100,6 @@ class IOEventLoop { event_base* ebase_; std::vector<std::unique_ptr<IOEvent>> events_; bool has_error_; - bool use_precise_timer_; bool in_loop_; }; |