PHP: Get CPU usage of ImageMagick/GraphicsMagick

tpoxa

New Member
In PHP, is there a way I can capture what the CPU usage is of each ImagaMagick/GraphicsMagick method I execute? Memory usage would be nice, too.Basically, I'm trying to benchmark how much resources each library uses in my application.Failed attempt:\[code\]exec('convert a.jpg a.png');$result = array();// Loop until process is detecteddo{ exec('ps -eo comm,%cpu,%mem | grep ' . "convert", $result);}while($result === array());// Display the changing CPU and memory usage of the processdo{ print_r($result); exec('ps -eo comm,%cpu,%mem | grep ' . "convert", $result);}while($result !== array());\[/code\]
 
Back
Top