diff options
author | Matthew Wild <mwild1@gmail.com> | 2016-06-28 14:49:44 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2016-06-28 14:49:44 +0100 |
commit | 6fc4ad3aefeab816af4b13df7d877386958a510f (patch) | |
tree | 70075a9795190bc0cd62e2e885a4be2ad1ab80a3 /util | |
parent | 03e138c59a2b3b26c9900f49f04c75bc4f203c53 (diff) | |
download | prosody-6fc4ad3aefeab816af4b13df7d877386958a510f.tar.gz prosody-6fc4ad3aefeab816af4b13df7d877386958a510f.zip |
util.time: New tiny library to abstract LuaSocket's gettime() function, so we can use other sources in the future
Diffstat (limited to 'util')
-rw-r--r-- | util/time.lua | 8 |
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; +} |