Mar 26, 2003 #1 farley99 MIS Feb 12, 2003 413 US Hi, I want to run a php script and then print out, this script excuted in 20 seconds or if it wont with with a script then a section of the script, something like you queried 2000 records in 15 seconds how can i do that?
Hi, I want to run a php script and then print out, this script excuted in 20 seconds or if it wont with with a script then a section of the script, something like you queried 2000 records in 15 seconds how can i do that?
Mar 26, 2003 1 #2 skiflyer Programmer Sep 24, 2002 2,213 US When you start the script run a time(); when you finish the script, or portion of it run a time(); Subtract that two. That'll I believe provide you seconds... (might be milliseconds, but I don't think so.) -Rob Upvote 0 Downvote
When you start the script run a time(); when you finish the script, or portion of it run a time(); Subtract that two. That'll I believe provide you seconds... (might be milliseconds, but I don't think so.) -Rob
Mar 26, 2003 1 #3 sleipnir214 Programmer May 6, 2002 15,350 US You could: Set a variable equal to the return of time() (http://www.php.net/manual/en/function.time.php) or microtime() (http://www.php.net/manual/en/function.microtime.php) at the beginning of your script or script section. Then do the same with a second variable at the end of the script. Then subtract the first variable from the second. Want the best answers? Ask the best questions: http://www.catb.org/~esr/faqs/smart-questions.htmlTANSTAAFL! Upvote 0 Downvote
You could: Set a variable equal to the return of time() (http://www.php.net/manual/en/function.time.php) or microtime() (http://www.php.net/manual/en/function.microtime.php) at the beginning of your script or script section. Then do the same with a second variable at the end of the script. Then subtract the first variable from the second. Want the best answers? Ask the best questions: http://www.catb.org/~esr/faqs/smart-questions.htmlTANSTAAFL!