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 | 8afacb5d92d6098f6eb85bbc32aff5632983bd5d (patch) | |
tree | 70075a9795190bc0cd62e2e885a4be2ad1ab80a3 /util/time.lua | |
parent | 8d589c476873ff77027c2f64840afaff70422d1c (diff) | |
download | prosody-8afacb5d92d6098f6eb85bbc32aff5632983bd5d.tar.gz prosody-8afacb5d92d6098f6eb85bbc32aff5632983bd5d.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/time.lua')
-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; +} |