<?php $forecast = new Forecast(); $forecastData = $forecast->getData(); if (is_array($forecastData)) { $displayData = $forecastData; } else { $msg_error = $forecastData; }
$threads = array(1, 5, 10, 25, 50, 100); $trials = 2; $index = 0; // count how many trials we did echo "Of " . count($requests) * count($threads) * $trials . " trials, running:"; $results = array(); // $results['num_requests']['num_threads']['trial'] for ($i = 0; $i < count($requests); $i++) { for ($j = 0; $j < count($threads); $j++) { for ($k = 0; $k < $trials; $k++) { $index++; echo " {$index}"; $sample = array_slice($this_day_in_history, 0, $requests[$i]); $start = microtime(true); $forecast = new Forecast($api_key, $threads[$j]); $responses = $forecast->getData($sample); $end = microtime(true); $results[$i][$j][$k] = $end - $start; // duration echo ";"; sleep(20); } } } echo "<br />\n"; ?> <!-- <?php print_r($results); ?>