From 8806da0d002f1ad9a3faa9a16a3729d9c7442de1 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 28 Jun 2016 14:49:44 +0100 Subject: [PATCH] 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 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; +} -- 2.30.2