projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
edc4a80
)
util.time: New tiny library to abstract LuaSocket's gettime() function, so we can...
author
Matthew Wild
<mwild1@gmail.com>
Tue, 28 Jun 2016 13:49:44 +0000
(14:49 +0100)
committer
Matthew Wild
<mwild1@gmail.com>
Tue, 28 Jun 2016 13:49:44 +0000
(14:49 +0100)
util/time.lua
[new file with mode: 0644]
patch
|
blob
diff --git a/util/time.lua
b/util/time.lua
new file mode 100644
(file)
index 0000000..
84cff87
--- /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;
+}