Install NewRelic for Application Monitoring. I don't have any affiliation to NewRelic, but I can tell you for sure that it's excellent for diagnosing performance issues and bottlenecks in code.
You get the Pro service for 14 days for free with a new account, and that should be long enough to diagnose your problem. Last time I used it on a PHP project, it was so very useful that we decided to pay for it for a longer period.
I'm aware this isn't a "free" solution, but neither is the developer's time in adding debug
microtime statements in every block and manually tracking queries through the system. This is why the small cost (and free trial) makes for a great idea just to evaluate the NewRelic system. It worked for me in the past for this similar kind of problem.