aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 042c30c..c6512ba 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -207,6 +207,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
207 207
208 private EventWaitHandle m_coopSleepHandle; 208 private EventWaitHandle m_coopSleepHandle;
209 209
210 private Stopwatch executionTimer = new Stopwatch();
211
210 public void ClearQueue() 212 public void ClearQueue()
211 { 213 {
212 m_TimerQueued = false; 214 m_TimerQueued = false;
@@ -278,7 +280,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
278 foreach (string api in am.GetApis()) 280 foreach (string api in am.GetApis())
279 { 281 {
280 m_Apis[api] = am.CreateApi(api); 282 m_Apis[api] = am.CreateApi(api);
281 m_Apis[api].Initialize(Engine, Part, ScriptTask, m_coopSleepHandle); 283 m_Apis[api].Initialize(Engine, Part, ScriptTask, m_coopSleepHandle, executionTimer);
282 } 284 }
283 285
284 try 286 try
@@ -753,8 +755,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
753 if (Suspended) 755 if (Suspended)
754 return 0; 756 return 0;
755 757
756 Stopwatch timer = new Stopwatch(); 758 executionTimer.Restart();
757 timer.Start();
758 759
759 try 760 try
760 { 761 {
@@ -762,9 +763,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
762 } 763 }
763 finally 764 finally
764 { 765 {
765 timer.Stop(); 766 executionTimer.Stop();
766 ExecutionTime.AddSample(timer); 767 ExecutionTime.AddSample(executionTimer);
767 Part.ParentGroup.Scene.AddScriptExecutionTime(timer.ElapsedTicks); 768 Part.ParentGroup.Scene.AddScriptExecutionTime(executionTimer.ElapsedTicks);
768 } 769 }
769 } 770 }
770 } 771 }