From f1d6b3e710787f89b76bc85aff83feac1d22dd0b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 24 Apr 2012 03:38:13 +0100 Subject: some reduction on time resolution efects on spare time report --- OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index 31f5b88..2d73380 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs @@ -267,21 +267,25 @@ namespace OpenSim.Region.Framework.Scenes float factor = 1 / statsUpdateFactor; if (reportedFPS <= 0) reportedFPS = 1; - float TotalFrameTime = 1000.0f * statsUpdateFactor / (float)reportedFPS; + float perframe = 1.0f / (float)reportedFPS; + float TotalFrameTime = 1000.0f * statsUpdateFactor * perframe; + + float targetframetime = 1100.0f / (float)m_nominalReportedFps; + float sparetime; - if (m_nominalReportedFps <= 0) + if (TotalFrameTime > targetframetime ) sparetime = 0; else { - sparetime = 1000.0f / (float)m_nominalReportedFps; - sparetime -= m_frameMS * perframe; + sparetime = TotalFrameTime - m_frameMS * perframe; if (sparetime < 0) sparetime = 0; else if (sparetime > TotalFrameTime) sparetime = TotalFrameTime; } + for (int i = 0; i < 23; i++) { -- cgit v1.1