summaryrefslogtreecommitdiff
path: root/lualibs-trac-inf.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2016-09-15 08:07:32 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2016-09-15 08:07:32 +0200
commit349d46eb1e7f1d13f5d823e818216b5ef1cee566 (patch)
tree6c721f136781389e80392c4e5d3c714bb089afb8 /lualibs-trac-inf.lua
parent8ee68eedb5cbdf06585f6f37bdc361b69437a25d (diff)
downloadlualibs-349d46eb1e7f1d13f5d823e818216b5ef1cee566.tar.gz
sync with Context as of 2016-09-15
Diffstat (limited to 'lualibs-trac-inf.lua')
-rw-r--r--lualibs-trac-inf.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/lualibs-trac-inf.lua b/lualibs-trac-inf.lua
index a1d7fb0..12a4f64 100644
--- a/lualibs-trac-inf.lua
+++ b/lualibs-trac-inf.lua
@@ -61,12 +61,13 @@ local function stoptiming(instance)
timer.timing = it - 1
else
local starttime = timer.starttime
- if starttime then
- local stoptime = clock()
- local loadtime = stoptime - starttime
- timer.stoptime = stoptime
- timer.loadtime = timer.loadtime + loadtime
- timer.timing = 0
+ if starttime and starttime > 0 then
+ local stoptime = clock()
+ local loadtime = stoptime - starttime
+ timer.stoptime = stoptime
+ timer.loadtime = timer.loadtime + loadtime
+ timer.timing = 0
+ timer.starttime = 0
return loadtime
end
end
@@ -183,7 +184,7 @@ end
function statistics.runtime()
stoptiming(statistics)
- stoptiming(statistics) -- somehow we can start the timer twice, but where
+ -- stoptiming(statistics) -- somehow we can start the timer twice, but where
return statistics.formatruntime(elapsedtime(statistics))
end