[PHP] Measuring CPU time
I haven't found a function to allow me to see elapsed CPU time to date in a function. Am I right in thinking none such exists? -- Cheers -- Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] measuring cpu time
On Wednesday 04 April 2001 04:43, you wrote: Im trying to optimize some php/mysql code. Does anyone know a way to measure the amount cpu time a php script consumes? Use "ab" (ApacheBench - comes with apache) if possible. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. - Edsger W. Dijkstra -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] measuring cpu time
The closest I know of is using microtime at the start and end of a piece of code to see how long it took. You'll want to run the script through a loop, usually around 10 times at least if it's not a big script, and then average together 10 tests. -- Plutarck Should be working on something... ...but forgot what it was. ""Brian Hardwick"" [EMAIL PROTECTED] wrote in message 000501c0bcb1$130f7fb0$0200a8c0@brianslaptop">news:000501c0bcb1$130f7fb0$0200a8c0@brianslaptop... Im trying to optimize some php/mysql code. Does anyone know a way to measure the amount cpu time a php script consumes? - Brian Hardwick Tangible Networks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] measuring cpu time
On 3 Apr 2001 19:29:14 -0700, Brian Hardwick [EMAIL PROTECTED] wrote: Im trying to optimize some php/mysql code. Does anyone know a way to measure the amount cpu time a php script consumes? Check out the POSIX functions - in particular the posix_times() function, which not only shows CPU time but also breaks it down into user (PHP's code) time and system (time spent by the kernel) time. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]