module

Profiler__

v1_9_1_378 - Show latest stable

No documentation available for this module.

Constants

PROFILE_PROC = proc{|event, file, line, id, binding, klass|\ncase event\nwhen "call", "c-call"\nnow = Process.times[0]\n@@stack.push [now, 0.0]\nwhen "return", "c-return"\nnow = Process.times[0]\nkey = [klass, id]\nif tick = @@stack.pop\ndata = (@@map[key] ||= [0, 0.0, 0.0, key])\ndata[0] += 1\ncost = now - tick[0]\ndata[1] += cost\ndata[2] += cost - tick[1]\n@@stack[-1][1] += cost if @@stack[-1]\nend\nend\n}

Files

  • lib/profiler.rb