: This article mainly introduces the execution time of php computing scripts. For more information about PHP tutorials, see.
// Modify the default php time zone date_default_timezone_get ('prc'); // use the subtle calculation of the php script execution time echo microtime (); echo "returns the current unix timestamp and number of microseconds "; echo"
"; ClassTimer {private $ startTime; private $ stopTime; function _ construct () {$ this-> startTime = 0; $ this-> stopTime = 0;} functionstart () {$ this-> startTime = microtime (true);} functionstop () {$ this-> stopTime = microtime (true);} functionspent () {return round ($ this-> stopTime-$ this-> startTime), 4) ;}$ timer = new Timer (); $ timer-> start (); usleep (1000); $ timer-> stop (); echo "when this script is executed". $ Timer-> spent ()."Seconds
";
The above introduces the execution time of php computing scripts, including some content. I hope my friends who are interested in PHP tutorials will be helpful.