display a sleep time of zero if forced spare time to zero, when sim fps is lower than desired, for better display coerence.

avinationmerge
UbitUmarov 2012-05-12 17:58:36 +01:00
parent 7461fe4554
commit 9b7023a159
1 changed files with 7 additions and 2 deletions

View File

@ -264,8 +264,12 @@ namespace OpenSim.Region.Framework.Scenes
float targetframetime = 1100.0f / (float)m_nominalReportedFps; float targetframetime = 1100.0f / (float)m_nominalReportedFps;
float sparetime; float sparetime;
float sleeptime;
if (TotalFrameTime > targetframetime) if (TotalFrameTime > targetframetime)
{
sparetime = 0; sparetime = 0;
sleeptime = 0;
}
else else
{ {
sparetime = m_frameMS - m_physicsMS - m_agentMS; sparetime = m_frameMS - m_physicsMS - m_agentMS;
@ -274,6 +278,7 @@ namespace OpenSim.Region.Framework.Scenes
sparetime = 0; sparetime = 0;
else if (sparetime > TotalFrameTime) else if (sparetime > TotalFrameTime)
sparetime = TotalFrameTime; sparetime = TotalFrameTime;
sleeptime = m_sleeptimeMS * perframe;
} }
// other MS is actually simulation time // other MS is actually simulation time
@ -363,7 +368,7 @@ namespace OpenSim.Region.Framework.Scenes
sb[21].StatValue = sparetime; sb[21].StatValue = sparetime;
sb[22].StatID = (uint)Stats.SimSleepTime; sb[22].StatID = (uint)Stats.SimSleepTime;
sb[22].StatValue = m_sleeptimeMS * perframe; sb[22].StatValue = sleeptime;
for (int i = 0; i < 23; i++) for (int i = 0; i < 23; i++)
{ {