diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/lualibs/lualibs-trac-inf.lua')
-rw-r--r-- | Master/texmf-dist/tex/luatex/lualibs/lualibs-trac-inf.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/luatex/lualibs/lualibs-trac-inf.lua b/Master/texmf-dist/tex/luatex/lualibs/lualibs-trac-inf.lua index f4c4e555787..12a4f646ff4 100644 --- a/Master/texmf-dist/tex/luatex/lualibs/lualibs-trac-inf.lua +++ b/Master/texmf-dist/tex/luatex/lualibs/lualibs-trac-inf.lua @@ -14,7 +14,7 @@ if not modules then modules = { } end modules ['trac-inf'] = { local type, tonumber, select = type, tonumber, select local format, lower, find = string.format, string.lower, string.find local concat = table.concat -local clock = os.gettimeofday or os.clock -- should go in environment +local clock = os.gettimeofday or os.clock -- should go in environment local setmetatableindex = table.setmetatableindex local serialize = table.serialize @@ -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,6 +184,7 @@ end function statistics.runtime() stoptiming(statistics) + -- stoptiming(statistics) -- somehow we can start the timer twice, but where return statistics.formatruntime(elapsedtime(statistics)) end |