From 8afacb5d92d6098f6eb85bbc32aff5632983bd5d Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 28 Jun 2016 14:49:44 +0100 Subject: util.time: New tiny library to abstract LuaSocket's gettime() function, so we can use other sources in the future --- util/time.lua | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 util/time.lua (limited to 'util/time.lua') diff --git a/util/time.lua b/util/time.lua new file mode 100644 index 00000000..84cff877 --- /dev/null +++ b/util/time.lua @@ -0,0 +1,8 @@ +-- Import gettime() from LuaSocket, as a way to access high-resolution time +-- in a platform-independent way + +local socket_gettime = require "socket".gettime; + +return { + now = socket_gettime; +} -- cgit v1.2.3