* @ingroup Benchmark
*/
-require_once( __DIR__ . '/Benchmarker.php' );
+require_once __DIR__ . '/Benchmarker.php';
/**
* Maintenance script that benchmarks SQL DELETE vs SQL TRUNCATE.
$this->insertData( $dbw );
- $start = wfTime();
+ $start = microtime( true );
$this->delete( $dbw );
- $end = wfTime();
+ $end = microtime( true );
- echo "Delete: " . $end - $start;
+ echo "Delete: " . sprintf( "%6.3fms", ( $end - $start ) * 1000 );
echo "\r\n";
$this->insertData( $dbw );
- $start = wfTime();
+ $start = microtime( true );
$this->truncate( $dbw );
- $end = wfTime();
+ $end = microtime( true );
- echo "Truncate: " . $end - $start;
+ echo "Truncate: " . sprintf( "%6.3fms", ( $end - $start ) * 1000 );
echo "\r\n";
$dbw->dropTable( 'test' );
}
/**
- * @param $dbw DatabaseBase
+ * @param $dbw DatabaseBase
* @return void
*/
private function insertData( $dbw ) {
}
/**
- * @param $dbw DatabaseBase
+ * @param $dbw DatabaseBase
* @return void
*/
private function delete( $dbw ) {
}
/**
- * @param $dbw DatabaseBase
+ * @param $dbw DatabaseBase
* @return void
*/
private function truncate( $dbw ) {
}
$maintClass = "BenchmarkDeleteTruncate";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;