[ create a new paste ] login | about

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

PHP, pasted on Jul 23:
<?php

$max = 100000;
$output = '';

ob_start();

$starttime = microtime(true);

for ($i = 0; $i < $max; $i++) {
        echo "$i $i $i $i $i $i $i $i $i $i";
}

$output .= 'Test one: ' . (microtime(true) - $starttime) . 's' . PHP_EOL;

$starttime = microtime(true);

for ($i = 0; $i < $max; $i++) {
        echo $i . ' ' . $i . ' ' . $i . ' ' . $i . ' ' . $i . ' ' . $i . ' ' . $i . ' ' . $i . ' ' . $i . ' ' . $i;
}

$output .= 'Test two: ' . (microtime(true) - $starttime) . 's' . PHP_EOL;

ob_end_clean();

echo $output;


Output:
1
2
Test one: 1.1698999404907s
Test two: 1.2209692001343s


Create a new paste based on this one


Comments: