From ebec508da5a0c08827e735730b83a08dad45bf13 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 29 Apr 2022 17:07:48 -0700 Subject: [PATCH] libuv: Loop.now --- src/libuv/Loop.zig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libuv/Loop.zig b/src/libuv/Loop.zig index 4583b0959..0bfa15c3c 100644 --- a/src/libuv/Loop.zig +++ b/src/libuv/Loop.zig @@ -70,6 +70,15 @@ pub fn backendTimeout(self: Loop) c_int { return c.uv_backend_timeout(self.loop); } +/// Return the current timestamp in milliseconds. The timestamp is cached at +/// the start of the event loop tick, see uv_update_time() for details and rationale. +/// +/// The timestamp increases monotonically from some arbitrary point in time. +/// Don’t make assumptions about the starting point, you will only get disappointed. +pub fn now(self: Loop) u64 { + return c.uv_now(self.loop); +} + /// Sets loop->data to data. pub fn setData(self: Loop, pointer: ?*anyopaque) void { c.uv_loop_set_data(self.loop, pointer);