1. 首页
  2. 数据库
  3. 其它
  4. php中计算程序运行时间的类代码

php中计算程序运行时间的类代码

上传者: 2021-02-01 20:01:13上传 PDF文件 21.83KB 热度 13次
复制代码 代码如下: class Timer { private $StartTime = 0;//程序运行开始时间 private $StopTime = 0;//程序运行结束时间 private $TimeSpent = 0;//程序运行花费时间 function start(){//程序运行开始 $this->StartTime = microtime(); } function stop(){//程序运行结束 $this->StopTime = microtime(); } function spent(){//程序运行花费的时间 if ($this->TimeSpent) { ret
下载地址
用户评论