Home >Backend Development >PHP Tutorial >Example sharing of using PHP to calculate page execution time
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:
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!