diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | 12 |
1 files changed, 8 insertions, 4 deletions
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 | |||
267 | float factor = 1 / statsUpdateFactor; | 267 | float factor = 1 / statsUpdateFactor; |
268 | if (reportedFPS <= 0) | 268 | if (reportedFPS <= 0) |
269 | reportedFPS = 1; | 269 | reportedFPS = 1; |
270 | float TotalFrameTime = 1000.0f * statsUpdateFactor / (float)reportedFPS; | 270 | |
271 | float perframe = 1.0f / (float)reportedFPS; | 271 | float perframe = 1.0f / (float)reportedFPS; |
272 | 272 | ||
273 | float TotalFrameTime = 1000.0f * statsUpdateFactor * perframe; | ||
274 | |||
275 | float targetframetime = 1100.0f / (float)m_nominalReportedFps; | ||
276 | |||
273 | float sparetime; | 277 | float sparetime; |
274 | if (m_nominalReportedFps <= 0) | 278 | if (TotalFrameTime > targetframetime ) |
275 | sparetime = 0; | 279 | sparetime = 0; |
276 | else | 280 | else |
277 | { | 281 | { |
278 | sparetime = 1000.0f / (float)m_nominalReportedFps; | 282 | sparetime = TotalFrameTime - m_frameMS * perframe; |
279 | sparetime -= m_frameMS * perframe; | ||
280 | if (sparetime < 0) | 283 | if (sparetime < 0) |
281 | sparetime = 0; | 284 | sparetime = 0; |
282 | else if (sparetime > TotalFrameTime) | 285 | else if (sparetime > TotalFrameTime) |
283 | sparetime = TotalFrameTime; | 286 | sparetime = TotalFrameTime; |
284 | } | 287 | } |
288 | |||
285 | 289 | ||
286 | for (int i = 0; i < 23; i++) | 290 | for (int i = 0; i < 23; i++) |
287 | { | 291 | { |