本文整理汇总了PHP中Benchmark::report方法的典型用法代码示例。如果您正苦于以下问题:PHP Benchmark::report方法的具体用法?PHP Benchmark::report怎么用?PHP Benchmark::report使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Benchmark
的用法示例。
在下文中一共展示了Benchmark::report方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: long_tcp
<?php
$config = [];
require_once "./config.php";
require_once "./Benchmark.php";
$bc = new Benchmark($config["test_function"]);
$bc->process_num = $config["process_num"];
$bc->request_num = $config["request_num"];
$bc->server_url = $config["server_url"];
$bc->server_config = parse_url($config["server_url"]);
$send_data = $config["send_data"];
$package_eof = $config["package_eof"];
$bc->process_req_num = intval($bc->request_num / $bc->process_num);
$bc->run();
$bc->report();
function long_tcp(Benchmark $bc)
{
global $send_data, $package_eof;
static $client = null;
static $i;
static $index;
$start = microtime(true);
if (empty($client)) {
$client = new swoole_client(SWOOLE_SOCK_TCP, SWOOLE_SOCK_SYNC);
$client->set(array('open_eof_check' => true, "package_eof" => $package_eof));
$end = microtime(true);
$conn_use = $end - $start;
$bc->max_conn_time = $conn_use;
$i = 0;
$index = 0;
if (!$client->connect($bc->server_config['host'], $bc->server_config['port'], 2)) {