Home >Backend Development >PHP Tutorial >Example sharing of using PHP to calculate page execution time

Example sharing of using PHP to calculate page execution time

黄舟
黄舟Original
2017-08-15 16:34:211209browse

In our daily development work, sometimes we will encounter the situation of calculating the page execution time. Although we rarely use this calculation function, we need to have a certain understanding of it, then we Today I will introduce to you about this PHP calculation page execution time!

First step: download the PHP class we need to use for this lesson to calculate page execution time:

http://www.php.cn/xiazai/leiku /818

Step 2: After the download is completed, find the php class file, extract it to the local server, and create a new php file!

Step 3: We call this class in this new file and instantiate this class:

<?php
include_once "codeteam.php"; //引入类文件
$t = new executeTime;      //实例化此类

The running results are as shown below:

Example sharing of using PHP to calculate page execution time

Note:

The time is updated every time the page is refreshed!

The above is the detailed content of Example sharing of using PHP to calculate page execution time. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn