aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Instance
diff options
context:
space:
mode:
authorMelanie Thielker2015-08-17 18:11:45 +0200
committerMelanie Thielker2015-08-17 18:11:45 +0200
commitee7debcca69d31573562dafead1f21d50931f632 (patch)
tree9c967ab1d0b639a209e13087acf5e6ceee7fde09 /OpenSim/Region/ScriptEngine/Shared/Instance
parentMerge branch 'master' of opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-ee7debcca69d31573562dafead1f21d50931f632.zip
opensim-SC-ee7debcca69d31573562dafead1f21d50931f632.tar.gz
opensim-SC-ee7debcca69d31573562dafead1f21d50931f632.tar.bz2
opensim-SC-ee7debcca69d31573562dafead1f21d50931f632.tar.xz
Revert "When scripts are sleeping, don't count that as execution time"
The approach is good but the way it is written breaks the architecture. Rewrite follows. This reverts commit a568f06b7faea807149205d0e47454e4883e4836.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Instance')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs13
1 files changed, 6 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 8033c90..8a744c3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -220,8 +220,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
220 220
221 private EventWaitHandle m_coopSleepHandle; 221 private EventWaitHandle m_coopSleepHandle;
222 222
223 private Stopwatch executionTimer = new Stopwatch();
224
225 public void ClearQueue() 223 public void ClearQueue()
226 { 224 {
227 m_TimerQueued = false; 225 m_TimerQueued = false;
@@ -293,7 +291,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
293 foreach (string api in am.GetApis()) 291 foreach (string api in am.GetApis())
294 { 292 {
295 m_Apis[api] = am.CreateApi(api); 293 m_Apis[api] = am.CreateApi(api);
296 m_Apis[api].Initialize(Engine, Part, ScriptTask, m_coopSleepHandle, executionTimer); 294 m_Apis[api].Initialize(Engine, Part, ScriptTask, m_coopSleepHandle);
297 } 295 }
298 296
299 try 297 try
@@ -768,7 +766,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
768 if (Suspended) 766 if (Suspended)
769 return 0; 767 return 0;
770 768
771 executionTimer.Restart(); 769 Stopwatch timer = new Stopwatch();
770 timer.Start();
772 771
773 try 772 try
774 { 773 {
@@ -776,9 +775,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
776 } 775 }
777 finally 776 finally
778 { 777 {
779 executionTimer.Stop(); 778 timer.Stop();
780 ExecutionTime.AddSample(executionTimer); 779 ExecutionTime.AddSample(timer);
781 Part.ParentGroup.Scene.AddScriptExecutionTime(executionTimer.ElapsedTicks); 780 Part.ParentGroup.Scene.AddScriptExecutionTime(timer.ElapsedTicks);
782 } 781 }
783 } 782 }
784 } 783 }