Skip to content

Instantly share code, notes, and snippets.

@juanpablocs
Last active November 13, 2015 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juanpablocs/bcf6644a42fc0be372e3 to your computer and use it in GitHub Desktop.
Save juanpablocs/bcf6644a42fc0be372e3 to your computer and use it in GitHub Desktop.
```
<?php
$file = "audio.mp3";
ob_start();
$start = microtime(true);
echo file_get_contents($file);
$end = microtime(true) - $start;
ob_end_clean();
echo 'file_get_contents: '.$end;
echo "\n";
ob_start();
$start = microtime(true);
echo readfile($file);
$end = microtime(true) - $start;
ob_end_clean();
echo 'readfile: '.$end;
echo "\n";
ob_start();
$start = microtime(true);
echo exec('cat ~/htdocs/josek/'.$file);
$end = microtime(true) - $start;
ob_end_clean();
echo 'exec: '.$end;
echo "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment