From a874c7d658c31400d3c6e74aff8a09f46989e1a4 Mon Sep 17 00:00:00 2001 From: Marius Date: Fri, 7 Jun 2013 13:40:24 +0300 Subject: beta 2013.06.07 12:25 --- tex/context/base/l-os.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'tex/context/base/l-os.lua') diff --git a/tex/context/base/l-os.lua b/tex/context/base/l-os.lua index 05ca0acdc..a4c0ac820 100644 --- a/tex/context/base/l-os.lua +++ b/tex/context/base/l-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