summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/trac-inf.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-01-19 13:13:21 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-01-19 13:13:21 +0100
commit3861c9ef2ffeffe824f05a255534d61800e27e7a (patch)
tree023d3e32dd6d7ef55f3eed41e23e012c32b07894 /tex/context/base/mkiv/trac-inf.lua
parent823bd4a7d8ff32c05807b02e650ecbd60b43e95d (diff)
downloadcontext-3861c9ef2ffeffe824f05a255534d61800e27e7a.tar.gz
2019-01-19 12:15:00
Diffstat (limited to 'tex/context/base/mkiv/trac-inf.lua')
-rw-r--r--tex/context/base/mkiv/trac-inf.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/trac-inf.lua b/tex/context/base/mkiv/trac-inf.lua
index 6c08f34f6..2c1dbbfe7 100644
--- a/tex/context/base/mkiv/trac-inf.lua
+++ b/tex/context/base/mkiv/trac-inf.lua
@@ -253,16 +253,23 @@ end
function statistics.runtime()
stoptiming(statistics)
-- stoptiming(statistics) -- somehow we can start the timer twice, but where
- return statistics.formatruntime(elapsedtime(statistics))
+ local runtime = lua.getruntime and lua.getruntime() or elapsedtime(statistics)
+ return statistics.formatruntime(runtime)
end
local report = logs.reporter("system")
-function statistics.timed(action)
+function statistics.timed(action,all)
starttiming("run")
action()
stoptiming("run")
- report("total runtime: %s seconds",elapsedtime("run"))
+ local runtime = tonumber(elapsedtime("run"))
+ if all then
+ local alltime = lua.getruntime and lua.getruntime() or elapsedtime(statistics)
+ report("total runtime: %0.3f seconds of %0.3f seconds",runtime,alltime)
+ else
+ report("total runtime: %0.3f seconds",runtime)
+ end
end
-- goodie