OSDN Git Service

fix "Command `\colon' already defined" error when fontspec is loaded without no-math...
[luatex-ja/luatexja.git] / src / ltj-debug.lua
index 8c57eda..ac51750 100644 (file)
@@ -88,6 +88,7 @@ ltjdbg.pformat = pformat
 -------------------- 所要時間合計
 require("socket")
 do
+   local max = math.max
    local gettime = socket.gettime
    local time_stat = {}
    local function start_time_measure(n)
@@ -104,15 +105,16 @@ do
    end
 
    local function print_measure()
+      stop_time_measure('RUN')
       local temp = {}
       for i,v in pairs(time_stat) do
         temp[#temp+1] = { i, v[1], v[2], v[2]/v[1] }
       end
       table.sort(temp, function (a,b) return (a[4]>b[4]) end)
       print()
-      print('desc', 'ave.', 'times', 'total')
+      print('desc', 'ave. (us)', 'times', 'total (ms)')
       for _,v in ipairs(temp) do
-        print ((v[1] .. '                '):sub(1,16), v[4], v[2], v[3])
+        print ((v[1] .. '                '):sub(1,16), 1000000*v[4], v[2], 1000*v[3])
       end
    end
    if luatexja.base then