PHP Pear benchmark_php Tutorial

Source: Internet
Author: User
Tags benchmark pear

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. ) ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.