Posted by Sam Yong on Sat 10 Oct 09:25
report abuse | download | new post
- <?php
- $n = 0;
- $i = 0;
- $time_start = microtime_float();
- while($i++ < 1000000){
- $n = $i / 2;
- }
- $time_end = microtime_float();
- $loadedin = (float)($time_end - $time_start);
- $n = 0;
- $i = 0;
- $time_start = microtime_float();
- while($i++ < 1000000){
- $n = $i >> 1;
- }
- $time_end = microtime_float();
- $loadedin = (float)($time_end - $time_start);
- function microtime_float(){
- return ((float)$usec + (float)$sec);
- }
- ?>
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.