class BenchHttpHttps extends Benchmarker {
public function __construct() {
parent::__construct();
- $this->mDescription = "Benchmark HTTP request vs HTTPS request.";
+ $this->addDescription( 'Benchmark HTTP request vs HTTPS request.' );
}
public function execute() {
- $this->bench( array(
- array( 'function' => array( $this, 'getHTTP' ) ),
- array( 'function' => array( $this, 'getHTTPS' ) ),
- ) );
+ $this->bench( [
+ [ 'function' => [ $this, 'getHTTP' ] ],
+ [ 'function' => [ $this, 'getHTTPS' ] ],
+ ] );
print $this->getFormattedResults();
}
static function doRequest( $proto ) {
- Http::get( "$proto://localhost/" );
+ Http::get( "$proto://localhost/", [], __METHOD__ );
}
// bench function 1