X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/98b26721ede0c7f2015bcf72ae8e61f100507de3..fe885e6eddd5bf1c893d6c6b6767f2cbba54e8a0:/luatz/gettime.lua?ds=inline diff --git a/luatz/gettime.lua b/luatz/gettime.lua index 008e95c..65366bd 100644 --- a/luatz/gettime.lua +++ b/luatz/gettime.lua @@ -32,6 +32,10 @@ _M.source , _M.resolution , _M.gettime = (function() return "socket.gettime()" , 1e-6 , socket.gettime end + if ngx and ngx.now then + return "ngx.now()" , 1e-3 , ngx.now + end + return "os.time()" , 1 , os.time end)()