2013-02-07 17:37:16 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$opt = getopt("", array(
|
2013-07-22 18:03:43 +04:00
|
|
|
/** @var string $engine */
|
2013-02-07 17:37:16 +04:00
|
|
|
"engine:",
|
2013-07-22 18:03:43 +04:00
|
|
|
/** @var string $template */
|
2013-02-07 17:37:16 +04:00
|
|
|
"template:",
|
2013-07-22 18:03:43 +04:00
|
|
|
/** @var string $data */
|
2013-02-07 17:37:16 +04:00
|
|
|
"data:",
|
2013-07-22 18:03:43 +04:00
|
|
|
/** @var boolean $double */
|
2013-02-07 17:37:16 +04:00
|
|
|
"double",
|
2013-07-22 18:03:43 +04:00
|
|
|
/** @var string $message */
|
|
|
|
"message:",
|
|
|
|
/** @var boolean $stress */
|
|
|
|
"stress:",
|
|
|
|
/** @var boolean $auto_reload */
|
|
|
|
"auto_reload"
|
2013-02-07 17:37:16 +04:00
|
|
|
));
|
|
|
|
|
|
|
|
require_once __DIR__.'/bootstrap.php';
|
|
|
|
|
2013-07-22 18:03:43 +04:00
|
|
|
$opt += array(
|
|
|
|
"message" => "plain",
|
|
|
|
"stress" => 0,
|
|
|
|
);
|
|
|
|
|
2013-02-07 17:37:16 +04:00
|
|
|
extract($opt);
|
|
|
|
|
2013-07-22 18:03:43 +04:00
|
|
|
|
|
|
|
$time = Benchmark::$engine($template, json_decode(file_get_contents($data), true), isset($double), $stress, isset($auto_reload));
|
|
|
|
|
|
|
|
printf(Benchmark::OUTPUT, $engine, $message, round($time, 4), round(memory_get_peak_usage()/1024/1024, 2));
|