Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function microtime_float(){
- list($usec, $sec) = explode(" ", microtime());
- return ((float)$usec + (float)$sec);
- }
- $file = 'favicon.ico';
- $u = 100;
- $time_start = microtime_float();
- while($u-- > 0){
- $data = file_get_contents($file);
- }
- $time_end = microtime_float();
- $loadedin = (float)($time_end - $time_start);
- echo $loadedin.' seconds<br/>';
- $u = 100;
- $time_start = microtime_float();
- while($u-- > 0){
- $fh=fopen($file, "r" );
- if($fh){
- while (!feof($fh)){
- $data.= fread($fh, 4096);
- }
- fclose($fh);
- }
- }
- $time_end = microtime_float();
- $loadedin = (float)($time_end - $time_start);
- echo $loadedin.' seconds<br/>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement