From 40cf2319dbf8b2d6796c7941a31795cd2cb55eb3 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 9 Jun 2013 11:34:33 +0200 Subject: sync with Context as of 2013-06-09 --- lualibs-os.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'lualibs-os.lua') diff --git a/lualibs-os.lua b/lualibs-os.lua index 05ca0ac..a4c0ac8 100644 --- a/lualibs-os.lua +++ b/lualibs-os.lua @@ -172,19 +172,21 @@ if not os.times then -- ? end end -os.gettimeofday = os.gettimeofday or os.clock -local startuptime = os.gettimeofday() +local gettimeofday = os.gettimeofday or os.clock +os.gettimeofday = gettimeofday + +local startuptime = gettimeofday() function os.runtime() - return os.gettimeofday() - startuptime + return gettimeofday() - startuptime end ---~ print(os.gettimeofday()-os.time()) ---~ os.sleep(1.234) ---~ print (">>",os.runtime()) ---~ print(os.date("%H:%M:%S",os.gettimeofday())) ---~ print(os.date("%H:%M:%S",os.time())) +-- print(os.gettimeofday()-os.time()) +-- os.sleep(1.234) +-- print (">>",os.runtime()) +-- print(os.date("%H:%M:%S",os.gettimeofday())) +-- print(os.date("%H:%M:%S",os.time())) -- no need for function anymore as we have more clever code and helpers now -- this metatable trickery might as well disappear -- cgit v1.2.3