From 3861c9ef2ffeffe824f05a255534d61800e27e7a Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sat, 19 Jan 2019 13:13:21 +0100 Subject: 2019-01-19 12:15:00 --- tex/context/base/mkiv/trac-inf.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'tex/context/base/mkiv/trac-inf.lua') 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 -- cgit v1.2.3