Benchmark
Basic information
version:1.2.9
Release date:2011-12-11 13:02 UTC
Description: Framework for testing PHP script performance (framework to benchmark PHP scripts or function calls.)
Download:benchmark Pear
Installation and Configuration
After downloading the file, unzip the file directory structure as follows
Run timer_example.php display as follows
function use
timer.php
Main functions:
$timer->start () start tag is equivalent to $timer->setmarker ("Start")
$timer->setmarker (' Mark '); Mark the time, Percent $timer->stop () end tag that is marked to the previous tag when the page is returned is equivalent to $timer->setmarker ('stop')
$timer->display (); Output to Page
Test Is_file and File_exists performance comparison
Start (); for ($index = 0; $index < 10000; $index + +) { //To determine if the given file name is a normal file is_file ($filename);} $timer->setmarker (' Is_file '); for ($index = 0; $index < 10000; $index + +) { //check file or directory for presence file_exists ($ filename);} $timer->setmarker (' file_exists '); $timer->stop (); $timer->display ();
<喎?http: www.bkjia.com="" kf="" ware="" vc="" "="" target="_blank" class="keylink"> vcd4kpha+pgjypgo8l3a+cjwvymxvy2txdw90zt4kpha+pc9wpgo8cd48yni+cjwvcd4kpgjsb2nrcxvvdgu+ cjxwpjwvcd4kpggzpkl0zxjhdguucghwpc9omz4kpgjsb2nrcxvvdgu+ cmz1bmn0aw9uihj1bigpicagintl0naxmdc0znvzzxla4gvhdle9t6iyorsrss7k/ Agudgvzdkgvimd9o7okymvuy2htyxjrlt5ydw4omtawlca= "User->eat ', ' test ');
function get () returns the execution time and average time of the functions
Run (5, ' o->foo ', ' Test '), $result = $benchmark->get (); Var_dump ($result);? >
http://www.bkjia.com/PHPjc/755791.html www.bkjia.com true http://www.bkjia.com/PHPjc/755791.html techarticle Benchmark Basic information version:1.2.9 Release date:2011-12-11 13:02 UTC Description: Framework for testing PHP script performance (framework to Benchmark PHP Scripts or function calls. ) ...