[ create a new paste ] login | about

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

PHP, pasted on Aug 5:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

$string = 'thisismystring';

$i=1000000;
$start = microtime(true)."\n";
while($i--) {
strlen($string)>15 ? 'yes' : 'no';
}
$end1 = microtime(true)."\n";
$i=1000000;
while($i--) {
isset($string[16]) ? 'yes' : 'no';
}
$end2 = microtime(true)."\n";

echo $end1 - $start . "\n";
echo $end2 - $end1 . "\n";

?>


Output:
1
2
0.84330010414124
0.291100025177


Create a new paste based on this one


Comments: