util.time: New tiny library to abstract LuaSocket's gettime() function, so we can use other sources in the future
authorMatthew Wild <mwild1@gmail.com>
Tue, 28 Jun 2016 14:49:44 +0100
changeset 7464 72e48bddf617
parent 7463 726b088f9408
child 7465 ced4e800f42a
child 7466 3b6e7ce9431f
util.time: New tiny library to abstract LuaSocket's gettime() function, so we can use other sources in the future
util/time.lua
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/util/time.lua	Tue Jun 28 14:49:44 2016 +0100
@@ -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;
+}