lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Especially with values "l" and 50000, I would have expected the debug counter to be far lower than the loop counter.
> What am I missing? Any help is appreciated.

* http://www.lua.org/manual/5.2/manual.html#pdf-debug.sethook

   With a count different from zero, the hook is called after every
   count instructions.

"instructions" here means opcode instructions of the virtual machine.

So, with values "l" and 50000, the hook is called for every line and for
every 50000 instructions executed. Each line in your loop has less than a
dozen instructions, so the line calls completely dominates the counting.

-- Roberto