diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index e9589b8..94f1b15 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | |||
@@ -253,24 +253,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
253 | physfps = 0; | 253 | physfps = 0; |
254 | 254 | ||
255 | #endregion | 255 | #endregion |
256 | |||
257 | //Our time dilation is 0.91 when we're running a full speed, | ||
258 | // therefore to make sure we get an appropriate range, | ||
259 | // we have to factor in our error. (0.10f * statsUpdateFactor) | ||
260 | // multiplies the fix for the error times the amount of times it'll occur a second | ||
261 | // / 10 divides the value by the number of times the sim heartbeat runs (10fps) | ||
262 | // Then we divide the whole amount by the amount of seconds pass in between stats updates. | ||
263 | |||
264 | // 'statsUpdateFactor' is how often stats packets are sent in seconds. Used below to change | ||
265 | // values to X-per-second values. | ||
266 | |||
267 | float factor = 1 / statsUpdateFactor; | 256 | float factor = 1 / statsUpdateFactor; |
268 | if (reportedFPS <= 0) | 257 | if (reportedFPS <= 0) |
269 | reportedFPS = 1; | 258 | reportedFPS = 1; |
270 | 259 | ||
271 | float perframe = 1.0f / (float)reportedFPS; | 260 | float perframe = 1.0f / (float)reportedFPS; |
272 | 261 | ||
273 | float TotalFrameTime = 1000.0f * statsUpdateFactor * perframe; | 262 | float TotalFrameTime = m_frameMS * perframe; |
274 | 263 | ||
275 | float targetframetime = 1100.0f / (float)m_nominalReportedFps; | 264 | float targetframetime = 1100.0f / (float)m_nominalReportedFps; |
276 | 265 | ||
@@ -279,7 +268,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
279 | sparetime = 0; | 268 | sparetime = 0; |
280 | else | 269 | else |
281 | { | 270 | { |
282 | sparetime = TotalFrameTime - m_frameMS * perframe; | 271 | sparetime = m_frameMS - m_physicsMS - m_agentMS; |
272 | sparetime *= perframe; | ||
283 | if (sparetime < 0) | 273 | if (sparetime < 0) |
284 | sparetime = 0; | 274 | sparetime = 0; |
285 | else if (sparetime > TotalFrameTime) | 275 | else if (sparetime > TotalFrameTime) |
@@ -290,7 +280,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
290 | // m_otherMS = m_frameMS - m_physicsMS - m_imageMS - m_netMS - m_agentMS; | 280 | // m_otherMS = m_frameMS - m_physicsMS - m_imageMS - m_netMS - m_agentMS; |
291 | // m_imageMS m_netMS are not included in m_frameMS | 281 | // m_imageMS m_netMS are not included in m_frameMS |
292 | 282 | ||
293 | m_otherMS = m_frameMS - m_physicsMS - m_agentMS; | 283 | m_otherMS = m_frameMS - m_physicsMS - m_agentMS - m_sleeptimeMS; |
294 | if (m_otherMS < 0) | 284 | if (m_otherMS < 0) |
295 | m_otherMS = 0; | 285 | m_otherMS = 0; |
296 | 286 | ||