diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/trac-inf.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/trac-inf.lua | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-inf.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-inf.lua index 7a5c35fd5fa..439e8b2dc7c 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/trac-inf.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/trac-inf.lua @@ -82,13 +82,9 @@ local seconds = function(n) return n or 0 end -- -- end -local function starttiming(instance,reset) +local function starttiming(instance) local timer = timers[instance or "notimer"] local it = timer.timing - if reset then - it = 0 - timer.loadtime = 0 - end if it == 0 then timer.starttime = ticks() if not timer.loadtime then @@ -127,24 +123,6 @@ local function elapsed(instance) end end -local function currenttime(instance) - if type(instance) == "number" then - return instance - else - local timer = timers[instance or "notimer"] - local it = timer.timing - if it > 1 then - -- whatever - else - local starttime = timer.starttime - if starttime and starttime > 0 then - return seconds(timer.loadtime + ticks() - starttime) - end - end - return 0 - end -end - local function elapsedtime(instance) return format("%0.3f",elapsed(instance)) end @@ -163,7 +141,6 @@ statistics.hastiming = hastiming statistics.resettiming = resettiming statistics.starttiming = starttiming statistics.stoptiming = stoptiming -statistics.currenttime = currenttime statistics.elapsed = elapsed statistics.elapsedtime = elapsedtime statistics.elapsedindeed = elapsedindeed @@ -252,26 +229,17 @@ end function statistics.runtime() stoptiming(statistics) - -- stoptiming(statistics) -- somehow we can start the timer twice, but where - local runtime = lua.getruntime and lua.getruntime() or elapsedtime(statistics) - return statistics.formatruntime(runtime) + -- stoptiming(statistics) -- somehow we can start the timer twice, but where + return statistics.formatruntime(elapsedtime(statistics)) end local report = logs.reporter("system") -function statistics.timed(action,all) +function statistics.timed(action) starttiming("run") action() stoptiming("run") - local runtime = tonumber(elapsedtime("run")) - if all then - local alltime = tonumber(lua.getruntime and lua.getruntime() or elapsedtime(statistics)) - if alltime and alltime > 0 then - report("total runtime: %0.3f seconds of %0.3f seconds",runtime,alltime) - return - end - end - report("total runtime: %0.3f seconds",runtime) + report("total runtime: %s seconds",elapsedtime("run")) end -- goodie |