diff options
Diffstat (limited to 'includes/normal/UtfNormalBench.php')
-rw-r--r-- | includes/normal/UtfNormalBench.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/includes/normal/UtfNormalBench.php b/includes/normal/UtfNormalBench.php index 944c4435..89de9290 100644 --- a/includes/normal/UtfNormalBench.php +++ b/includes/normal/UtfNormalBench.php @@ -19,11 +19,15 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html - * + * * @file * @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' ); } @@ -34,10 +38,6 @@ require_once 'UtfNormal.php'; define( 'BENCH_CYCLES', 5 ); -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', @@ -80,7 +80,7 @@ function benchmarkTest( &$u, $filename, $desc ) { } } -function benchTime(){ +function benchTime() { $st = explode( ' ', microtime() ); return (float)$st[0] + (float)$st[1]; } |