0,
'index' => 0,
'includes' => 0,
'twitter' => 0,
'lastfm' => 0,
'hulu' => 0,
'sc2ranks' => 0,
'wow' => 0,
'steam' => 0,
'links' => 0,
);
$benchmark_start = microtime(true);
include_once('lib/misc.php');
$db_config = json_decode(file_get_contents('conf/database.conf'));
include_once('lib/database.php');
$db = new Database($db_config->hostname,$db_config->username,$db_config->password,$db_config->table);
$benchmark['includes'] = microtime(true) - $benchmark_start;
$benchmark_start = microtime(true);
include_once('lib/twitter.php');
$twt = new Twitter;
$latest_tweet = $twt->get_latest_tweet('atomaka');
$latest_tweet_since = time_since(strtotime($latest_tweet['created_at']));
$benchmark['twitter'] = microtime(true) - $benchmark_start;
$benchmark_start = microtime(true);
include_once('lib/lastfm.php');
$lfm = new Lastfm;
$latest_song = $lfm->get_latest_song('atomaka');
$latest_song_since = ($latest_song['@attributes']['nowplaying']) ? 'Listening now' : time_since(strtotime($latest_song['date'] . ' UTC')) . ' ago';
$latest_song_image = (is_array($latest_song['image'][1])) ? 'img/lastfm/blank_album64.png' : $latest_song['image'][1];
$benchmark['lastfm'] = microtime(true) - $benchmark_start;
$benchmark_start = microtime(true);
include_once('lib/hulu.php');
$hul = new Hulu;
$latest_hulu = $hul->get_latest_show('atomaka');
$latest_hulu_since = time_since(strtotime($latest_hulu['pubdate']));
preg_match('/get_team('Gaffer',888,1);
$benchmark['sc2ranks'] = microtime(true) - $benchmark_start;
$benchmark_start = microtime(true);
//$latest_achievement = $wow->get_latest_achievement('gaffer','crushridge');
$benchmark['wow'] = microtime(true) - $benchmark_start;
$benchmark_start = microtime(true);
include_once('lib/steamclass.php');
$stm = new Steam('76561197993725971');
$steam = $stm->profile();
$steam_games = $stm->recentgames();
$benchmark['steam'] = microtime(true) - $benchmark_start;
$benchmark_start = microtime(true);
include_once('lib/links.php');
$lnk = new Links($db);
$links = $lnk->get_latest_links(15);
$benchmark['links'] = microtime(true) - $benchmark_start;
$benchmark_start = microtime(true);
?>
Who is Andrew?
'none','time' => 0);
foreach($benchmark as $part=>$time)
{
if($time > $max['time'])
{
$max['time'] = $time;
$max['part'] = $part;
}
$benchmark['total'] += $time;
}
?>
Prepared in s. Damn you, (s)
© Andrew Tomaka 2010-2011. [
admin ]
';
?>