util.time: New tiny library to abstract LuaSocket's gettime() function, so we can...
authorMatthew Wild <mwild1@gmail.com>
Tue, 28 Jun 2016 13:49:44 +0000 (14:49 +0100)
committerMatthew Wild <mwild1@gmail.com>
Tue, 28 Jun 2016 13:49:44 +0000 (14:49 +0100)
util/time.lua [new file with mode: 0644]

diff --git a/util/time.lua b/util/time.lua
new file mode 100644 (file)
index 0000000..84cff87
--- /dev/null
@@ -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;
+}