diff --git a/public/include/pages/api/getdashboarddata.inc.php b/public/include/pages/api/getdashboarddata.inc.php index 4d8fef48..98cbded1 100644 --- a/public/include/pages/api/getdashboarddata.inc.php +++ b/public/include/pages/api/getdashboarddata.inc.php @@ -35,7 +35,6 @@ if ( ! $user->isAdmin($user_id) && ($_REQUEST['id'] != $user_id && !empty($_REQU $bitcoin->can_connect() === true ? $dNetworkHashrate = $bitcoin->query('getnetworkhashps') : $dNetworkHashrate = 0; // Some settings -$start = microtime(true); if ( ! $interval = $setting->getValue('statistics_ajax_data_interval')) $interval = 300; if ( ! $dPoolHashrateModifier = $setting->getValue('statistics_pool_hashrate_modifier') ) $dPoolHashrateModifier = 1; if ( ! $dPersonalHashrateModifier = $setting->getValue('statistics_personal_hashrate_modifier') ) $dPersonalHashrateModifier = 1; @@ -49,8 +48,6 @@ $dPersonalHashrate = $statistics->getUserHashrate($id, $interval); $dPersonalSharerate = $statistics->getUserSharerate($id, $interval); $statistics->setGetCache(true); -$runtime = (microtime(true) - $start) * 1000; - // Apply pool modifiers $dPersonalHashrate = $dPersonalHashrate * $dPersonalHashrateModifier; $dPoolHashrate = $dPoolHashrate * $dPoolHashrateModifier; @@ -58,7 +55,7 @@ $dNetworkHashrate = $dNetworkHashrate / 1000 * $dNetworkHashrateModifier; // Output JSON format echo json_encode(array($_REQUEST['action'] => array( - 'datatime' => $runtime, + 'runtime' => (microtime(true) - $dTimeStart) * 1000, 'personal' => array ( 'hashrate' => $dPersonalHashrate, 'sharerate' => $dPersonalSharerate ), 'pool' => array( 'hashrate' => $dPoolHashrate ), 'network' => array( 'hashrate' => $dNetworkHashrate ), diff --git a/public/index.php b/public/index.php index ac7c4154..1933bf8d 100644 --- a/public/index.php +++ b/public/index.php @@ -18,6 +18,9 @@ limitations under the License. */ +// Used for performance calculations +$dTimeStart = microtime(true); + // This should be okay define("BASEPATH", "./"); @@ -81,10 +84,10 @@ require_once(INCLUDE_DIR . '/smarty_globals.inc.php'); // Load debug information into template $debug->append("Loading debug information into template", 4); $smarty->assign('DebuggerInfo', $debug->getDebugInfo()); +$smarty->assign('RUNTIME', (microtime(true) - $dTimeStart) * 1000); // Display our page -if (!@$supress_master) - $smarty->display("master.tpl", $smarty_cache_key); +if (!@$supress_master) $smarty->display("master.tpl", $smarty_cache_key); // Unset any temporary values here unset($_SESSION['POPUP']);