Created
February 8, 2017 12:45
-
-
Save takedajs/883d4e7db04ceb38eba7882eb60e89b1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| require 'vendor/autoload.php'; | |
| use GuzzleHttp\Client; | |
| $client = new Client([ | |
| 'base_url' => 'http://192.168.33.10', | |
| ]); | |
| $api_data = [ | |
| "no_1" => "/api.php?no=1", | |
| "no_2" => "/api.php?no=2", | |
| "no_3" => "/api.php?no=3", | |
| ]; | |
| // ベンチマークstart | |
| //$time_start = microtime(true); | |
| $results = []; | |
| foreach ($api_data as $key => $url) { | |
| $results[$key] = $client->get($url)->getBody()->getContents(); | |
| } | |
| // ベンチマークfinish | |
| //$time = microtime(true) - $time_start; | |
| //echo $time . "秒 <br />"; | |
| var_dump($results); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment