Beispiel #1
0
void LLPerfStats::updatePerFrameStats()
{
    (void) LLStatsConfigFile::instance().checkAndReload();
	static LLFrameTimer performance_stats_timer;
	if ( frameStatsIsRunning() )
	{
		if ( mReportPerformanceStatInterval == 0 )
		{	// Record info every frame
			if ( mSkipFirstFrameStats )
			{	// Skip the first time - was started this frame
				mSkipFirstFrameStats = FALSE;
			}
			else
			{
				dumpIntervalPerformanceStats();
			}
		}
		else
		{
			performance_stats_timer.setTimerExpirySec( getReportPerformanceInterval() );
			if (performance_stats_timer.checkExpirationAndReset( mReportPerformanceStatInterval ))
			{
				dumpIntervalPerformanceStats();
			}
		}
		
		if ( LLFrameTimer::getElapsedSeconds() > mReportPerformanceStatEnd )
		{	// Reached end of time, clear it to stop reporting
			setReportPerformanceDuration(0.f);			// Don't set mReportPerformanceStatEnd directly	
            llinfos << "Recording performance stats completed" << llendl;
		}
	}
}
	void idle()
	{

		const F32 SECS_BETWEEN_REQUESTS = 0.1f;
		if (!sRequestTimer.checkExpirationAndReset(SECS_BETWEEN_REQUESTS))
		{
			return;
		}

		// Must be large relative to above
		const F32 ERASE_EXPIRED_TIMEOUT = 60.f; // seconds
		if (sEraseExpiredTimer.checkExpirationAndReset(ERASE_EXPIRED_TIMEOUT))
		{
			eraseExpired();
		}


		if(!sAskQueue.empty())
		{
			requestExperiences();
		}
	}