aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--util/time.lua8
1 files changed, 8 insertions, 0 deletions
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;
+}