- $this->insertData( $dbw );
-
- $start = microtime( true );
-
- $this->delete( $dbw );
-
- $end = microtime( true );
-
- echo "Delete: " . sprintf( "%6.3fms", ( $end - $start ) * 1000 );
- echo "\r\n";
-
- $this->insertData( $dbw );
-
- $start = microtime( true );
-
- $this->truncate( $dbw );
-
- $end = microtime( true );
-
- echo "Truncate: " . sprintf( "%6.3fms", ( $end - $start ) * 1000 );
- echo "\r\n";
+ $this->bench( [
+ 'Delete' => [
+ 'setup' => function () use ( $dbw ) {
+ $this->insertData( $dbw );
+ },
+ 'function' => function () use ( $dbw ) {
+ $this->delete( $dbw );
+ }
+ ],
+ 'Truncate' => [
+ 'setup' => function () use ( $dbw ) {
+ $this->insertData( $dbw );
+ },
+ 'function' => function () use ( $dbw ) {
+ $this->truncate( $dbw );
+ }
+ ]
+ ] );