You may wonder why I would want to do this. I'm trying to debug PHP performance on an embedded system. Don't have access to any kind of tools on the device.
I was thinking if I could just do a simple microseconds
calculation on every call, it would work.
Is there a way to do it? Essentially wrap all of my functions (not built in php).
This wouldn't be for production of course.
You can use declare(ticks=1000);
to run an callback, like:
// you can use this:
declare(ticks=1);
// A function called on each tick event
function tick_handler()
{
debug_backtrace();//get function name
microtime();//get time
}
you only have to get the right number e.g. 1000
for your tests cycles