X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Fltj-debug.lua;h=ac517500e8e0497480f6cc039d8c26a7a626bdab;hb=ab23049deb6fb90ca689fdf4924b3783f08f8f2e;hp=d4a084a24170a905d30ddf6881670ef9cafba3ce;hpb=4285693e49ee8fdf6681a1343a0e8f86a5e73511;p=luatex-ja%2Fluatexja.git diff --git a/src/ltj-debug.lua b/src/ltj-debug.lua index d4a084a..ac51750 100644 --- a/src/ltj-debug.lua +++ b/src/ltj-debug.lua @@ -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,8 +105,16 @@ do end local function print_measure() + stop_time_measure('RUN') + local temp = {} for i,v in pairs(time_stat) do - print (i, tostring(v[1]) .. ' times', tostring(v[2]) .. ' sec.') + 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. (us)', 'times', 'total (ms)') + for _,v in ipairs(temp) do + print ((v[1] .. ' '):sub(1,16), 1000000*v[4], v[2], 1000*v[3]) end end if luatexja.base then