Created
January 14, 2017 10:12
-
-
Save maurobringolf/123bba9fcef5c42330323894d47913e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "Running full GET requests... \n"; | |
$sum = 0; | |
for( $i = 1; $i <= 100; ++$i ) { | |
$start = microtime(true); | |
$ch = curl_init(); | |
curl_setopt( $ch, CURLOPT_URL, "http://api.wordpress.org/plugins/info/1.0/woocommerce" ); | |
curl_setopt( $ch, CURLOPT_GET, true ); | |
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); | |
$result=curl_exec($ch); | |
$end = microtime(true); | |
$sum += $end - $start; | |
} | |
echo "The average time for a full GET was:" . $sum / 100 . "\n"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment