Is it possible to run a program in 'steps,' between which the state is paused?
The debug lib, allowing to take control of the whole program, is disabled in most sandboxed environments including wikipedia's.
However, bytecode instruction and line changes both are poor metrics to measure time, cpu or any other kind of resource usage. Measuring process time is relatively easy and much more accurate.