util/time.lua
author Kim Alvefur <zash@zash.se>
Sun, 25 Nov 2018 13:16:17 +0100
changeset 9647 bb8486491b48
parent 7464 72e48bddf617
permissions -rw-r--r--
mod_proxy65: Check what port is used at the time of the query Could have changed between startup and time of request
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7464
72e48bddf617 util.time: New tiny library to abstract LuaSocket's gettime() function, so we can use other sources in the future
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
     1
-- Import gettime() from LuaSocket, as a way to access high-resolution time
72e48bddf617 util.time: New tiny library to abstract LuaSocket's gettime() function, so we can use other sources in the future
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
     2
-- in a platform-independent way
72e48bddf617 util.time: New tiny library to abstract LuaSocket's gettime() function, so we can use other sources in the future
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
     3
72e48bddf617 util.time: New tiny library to abstract LuaSocket's gettime() function, so we can use other sources in the future
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
     4
local socket_gettime = require "socket".gettime;
72e48bddf617 util.time: New tiny library to abstract LuaSocket's gettime() function, so we can use other sources in the future
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
     5
72e48bddf617 util.time: New tiny library to abstract LuaSocket's gettime() function, so we can use other sources in the future
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
     6
return {
72e48bddf617 util.time: New tiny library to abstract LuaSocket's gettime() function, so we can use other sources in the future
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
     7
	now = socket_gettime;
72e48bddf617 util.time: New tiny library to abstract LuaSocket's gettime() function, so we can use other sources in the future
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
     8
}