Php computing script execution time

Source: Internet
Author: User
: 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.