From 1cfee4e84cd13c06d3450a6a286c4acf0443eed9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 24 Apr 2012 04:57:59 +0100 Subject: display heatbeat sleep time in stats. This may not be good for general use, but for testing/debug --- OpenSim/Region/Framework/Scenes/Scene.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 3e08128..32a98b4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1390,6 +1390,7 @@ namespace OpenSim.Region.Framework.Scenes int tmpPhysicsMS, tmpPhysicsMS2, tmpAgentMS, tmpTempOnRezMS, evMS, backMS, terMS; int previousFrameTick; int maintc; + int sleepMS; while (!m_shuttingDown && (endFrame == null || Frame < endFrame)) { @@ -1557,9 +1558,13 @@ namespace OpenSim.Region.Framework.Scenes m_firstHeartbeat = false; + sleepMS = Util.EnvironmentTickCount(); if (maintc > 0) Thread.Sleep(maintc); + sleepMS = Util.EnvironmentTickCountSubtract(sleepMS); + StatsReporter.addSleepMS(sleepMS); + // Optionally warn if a frame takes double the amount of time that it should. if (DebugUpdates && Util.EnvironmentTickCountSubtract( -- cgit v1.1