PHP脚本的执行时间测试–pear与benchmark

  • Post author:
  • Post category:php


参考文章:

http://www.jb51.net/article/29064.htm

http://www.jb51.net/article/29065.htm

一、安装pear

可以再安装php的时候同时设置参数,安装pear扩展,若是没有安装,则可以使用curl方式安装,需要提前安装curl。

步骤如下:

下载:

curl -o go-pear.php http://pear.php.net/go-pear.phar

安装:

php go-pear.php

安装成功检查版本

pear version

二、安装benchmark

pear install Benchmark-1.2.7

其实若只想进行php运行时间的测试,只有下载到PEAR.php、Iterate.php、Timer.php、Profiler.ph即可,然后模仿timer_example.php中的示例即可。上述文件在以上步骤执行后都会得到,直接find就好。



版权声明:本文为wzxsjdt原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。