[ create a new paste ] login | about

Link: http://codepad.org/hRXUR4Z2    [ raw code | output | fork ]

PHP, pasted on Oct 4:
<?php

$string = "blah/blah/blah";
$start = microtime(true);
$max = 1000;

for($i = 0; $i < $max; $i ++) {
    $e = explode("/", $string);
}

echo microtime(true) - $start, PHP_EOL;

$start = microtime(true);

function c4($str) {
    return explode("/", $str);
}

for($i = 0; $i < $max; $i ++) {
    $e = c4("/", $string);
}

echo microtime(true) - $start, PHP_EOL;


Output:
1
2
0.0016260147094727
0.0014748573303223


Create a new paste based on this one


Comments: