diff --git a/llarp/ev/ev.hpp b/llarp/ev/ev.hpp index f39d3041f..898d526a3 100644 --- a/llarp/ev/ev.hpp +++ b/llarp/ev/ev.hpp @@ -75,11 +75,11 @@ namespace llarp virtual bool running() const = 0; + // Returns a current steady clock time value representing the current time with event loop tick + // granularity. That is, the value is typically only updated at the beginning of an event loop + // tick. virtual llarp_time_t - time_now() const - { - return llarp::time_now_ms(); - } + time_now() const = 0; // Calls a function/lambda/etc. If invoked from within the event loop itself this calls the // given lambda immediately; otherwise it passes it to `call_soon()` to be queued to run at the diff --git a/llarp/ev/ev_libuv.hpp b/llarp/ev/ev_libuv.hpp index 86dacac79..62c3d5a4c 100644 --- a/llarp/ev/ev_libuv.hpp +++ b/llarp/ev/ev_libuv.hpp @@ -31,6 +31,12 @@ namespace llarp::uv bool running() const override; + llarp_time_t + time_now() const override + { + return m_Impl->now(); + } + void call_later(llarp_time_t delay_ms, std::function callback) override;