diff options
Diffstat (limited to 'includes/normal/UtfNormalMemStress.php')
-rw-r--r-- | includes/normal/UtfNormalMemStress.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/includes/normal/UtfNormalMemStress.php b/includes/normal/UtfNormalMemStress.php index 1277dc20..9732d762 100644 --- a/includes/normal/UtfNormalMemStress.php +++ b/includes/normal/UtfNormalMemStress.php @@ -26,6 +26,10 @@ * @ingroup UtfNormal */ +if( PHP_SAPI != 'cli' ) { + die( "Run me from the command line please.\n" ); +} + if( isset( $_SERVER['argv'] ) && in_array( '--icu', $_SERVER['argv'] ) ) { dl( 'php_utfnormal.so' ); } @@ -38,10 +42,6 @@ define( 'BENCH_CYCLES', 1 ); define( 'BIGSIZE', 1024 * 1024 * 10); // 10m ini_set('memory_limit', BIGSIZE + 120 * 1024 * 1024); -if( php_sapi_name() != 'cli' ) { - die( "Run me from the command line please.\n" ); -} - $testfiles = array( 'testdata/washington.txt' => 'English text', 'testdata/berlin.txt' => 'German text', @@ -82,7 +82,7 @@ function benchmarkTest( &$u, $filename, $desc ) { } } -function benchTime(){ +function benchTime() { $st = explode( ' ', microtime() ); return (float)$st[0] + (float)$st[1]; } |