diff options
Diffstat (limited to 'tex/context/base/trac-inf.lua')
-rw-r--r-- | tex/context/base/trac-inf.lua | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tex/context/base/trac-inf.lua b/tex/context/base/trac-inf.lua index 6ba3d348e..699e2b668 100644 --- a/tex/context/base/trac-inf.lua +++ b/tex/context/base/trac-inf.lua @@ -19,10 +19,16 @@ statistics = statistics or { } local statistics = statistics statistics.enable = true -statistics.threshold = 0.05 +statistics.threshold = 0.01 local statusinfo, n, registered, timers = { }, 0, { }, { } +table.setmetatableindex(timers,function(t,k) + local v = { timing = 0, loadtime = 0 } + t[k] = v + return v +end) + local function hastiming(instance) return instance and timers[instance] end @@ -33,14 +39,7 @@ end local function starttiming(instance) local timer = timers[instance or "notimer"] - if not timer then - timer = { } - timers[instance or "notimer"] = timer - end - local it = timer.timing - if not it then - it = 0 - end + local it = timer.timing or 0 if it == 0 then timer.starttime = clock() if not timer.loadtime then |