dydro/benchmark 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dydro/benchmark

Composer 安装命令:

composer require --dev dydro/benchmark

包简介

A comparison benchmarking utility

README 文档

README

A comparison benchmarking utility

PHP-Benchmark is intented to be used to compare libraries, or do small testing in your application

Latest Stable Version Build Status

Installation

Installation should be handled through Composer:

"require": {
    "dydro/benchmark": "dev-master"
}

Usage

Usage is very simple with Benchmark:

$benchmark = new Benchmark('MyProduct');
$manager = new Manager();
$manager->addBenchmark($benchmark);

$benchmark->start();
...do stuff...
$benchmark->stop();

echo $manager->getResults('MyProduct test');

Output

Depending on the environment in which PHP is running (CLI or non-CLI) Benchmark will spit out different responses:

CLI

+--------------------------------------------------------+
|                                                        |
|           BENCHMARK RESULTS -- 04.images.php           |
|                                                        |
+-------------------+----------------+-------------------+
|      PRODUCT      |    TIME (s)    |    MEMORY (kB)    |
+-------------------+----------------+-------------------+
|       FPDF        |    0.01311     |       599.8       |
+-------------------+----------------+-------------------+
|       TCPDF       |     0.4036     |     10946.85      |
+-------------------+----------------+-------------------+

HTML

<!doctype html>
<html>
    <head>
        <title>BENCHMARK RESULTS -- 04.images.php</title>
        <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
        <style>#dy-benchmark-results * {text-align: center;}</style>
    </head>
    <body>
        <div class="container">
            <div class="row">
                <div class="span12">
                    <table class="table table-striped table-hover table-bordered" id="dy-benchmark-results">
                        <thead>
                            <tr>
                                <th colspan="3">BENCHMARK RESULTS -- 04.images.php</th>
                            </tr>
                            <tr>
                                <th>PRODUCT</th>
                                <th>TIME (s)</th>
                                <th>MEMORY (kB)</th>
                            </tr>
                        </thead>
                        <tbody>
<tr><td>FPDF</td><td><span class="label label-success">0.01278</span></td><td><span class="label label-success">599.9</span></td></tr>
<tr><td>TCPDF</td><td><span class="label label-important">0.39344</span></td><td><span class="label label-important">10946.73</span></td></tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </body>
</html>

统计信息

  • 总下载量: 21
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2013-07-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固