I'm pretty sure this has never been asked before, which surprises me a little bit, but if it's a duplicate, please point at the right question :)
We have heavy lag on our servers and I started logging microtime()
at various keypoints in our system, but it's still not precise enough and I would like to know the microtime for every single line of code. However this would be an IMMENSE piece of work to do + every file would be double the size + it would be pretty stupid.
So I'd like to know if anyone has any ideas how for example I would set a flag ?log_test=1
in the url for example (with security measures of course) and it would echo microtime()
(or anything similar) after each line ending with a semicolon.
I realize this sounds ridiculous, but I'm just wondering if anyone has any ideas of capturing execution time as precise as possible without re-writing the code. We're using CodeIgniter by the way, in case it gives anyone ideas