Skip to content

Instantly share code, notes, and snippets.

@juanpablocs
Last active November 13, 2015 21:15
Embed
What would you like to do?
```
<?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