Search code examples
phpperformancetimephp-7processing-efficiency

PHP script processing/cpu time (Not wall clock time)


I'm trying to profile some PHP scripts I'm running. I'm already measuring the wall clock time but now I want to know how much time the cpu has dedicated to the script.

Is there any way to measure cpu time of a script? I'm using php7.1


Solution

  • AFAIK, you can use xhprof library to measure the cpu time. Here are guidelines of how you can use the library https://tideways.io/profiler/xhprof-for-php7-php5.6.