add skynet_now() for 64bit time

This commit is contained in:
Cloud Wu
2015-11-16 19:48:38 +08:00
parent 87bc0815f6
commit 2252409eaa
7 changed files with 32 additions and 36 deletions

View File

@@ -299,16 +299,19 @@ function skynet.localname(name)
end
end
function skynet.now()
return c.intcommand("NOW")
end
skynet.now = c.now
local starttime
function skynet.starttime()
return c.intcommand("STARTTIME")
if not starttime then
starttime = c.intcommand("STARTTIME")
end
return starttime
end
function skynet.time()
return skynet.now()/100 + skynet.starttime() -- get now first would be better
return skynet.now()/100 + starttime or skynet.starttime()
end
function skynet.exit()