diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2013-06-09 11:34:33 +0200 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-06-09 11:34:33 +0200 |
commit | 40cf2319dbf8b2d6796c7941a31795cd2cb55eb3 (patch) | |
tree | 3ccabaa43445a099852e45add9fa93574fab59bb /lualibs-os.lua | |
parent | c0eecc6f6ac9622b498134d8415010b077f4d57d (diff) | |
download | lualibs-40cf2319dbf8b2d6796c7941a31795cd2cb55eb3.tar.gz |
sync with Context as of 2013-06-09
Diffstat (limited to 'lualibs-os.lua')
-rw-r--r-- | lualibs-os.lua | 18 |
1 files changed, 10 insertions, 8 deletions
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 |