$exec_time = $time_post - $time_pre; echo '</br>Query Time: ' . $exec_time; } else { if ($_SESSION['clust_op'] == 'b') { // Instantiate a new API $api1 = new api(); // Instantiate a new formatter with the 3 result sets as properties $formatter1 = new formatter(new resultSet(), new resultSet(), new resultSet()); // Google Results for ($i = 0; $i < $_SESSION['results'] / 10; $i++) { // Get offset $offset = 1 + $i * 10; // Call Google API $api1->googleApi($query1, $offset); // Set Google JSON Data $formatter1->setGoogleJson($api1->returnGoogleJsonData(), $api1->returnGoogleJsonResultFlag()); $formatter1->formatGoogleJson($_SESSION['results'], $i * 10); } // Bing Results for ($i = 0; $i < ($_SESSION['results'] > 50 ? 2 : 1); $i++) { // Get offset $offset = 1 + $i * 50; // Call Bing API $api1->bingApi($query2, $_SESSION['results'], $offset); // Set BING JSON Data $formatter1->setBingJson($api1->returnBingJsonData(), $api1->returnBingJsonResultFlag()); $formatter1->formatBingJson($_SESSION['results'], $i * 50); } // Blekko Results $api1->blekkoApi($query3, $_SESSION['results'], 0); // Set BLEKKO JSON Data