How can I detect which function uses the cpu most? I get around 20 reqs/s usually, but the cpu usage is around %50 which is terrible. I have no doubts about the server's performance as it is mine.
I need to find out the most cpu consuming function in my script but I don't know how to do it. I use custom script, I've written it all.