diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 4bb0b74..123f8ca 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -41,7 +41,6 @@ using OpenMetaverse.StructuredData; | |||
41 | using Nini.Config; | 41 | using Nini.Config; |
42 | using OpenSim; | 42 | using OpenSim; |
43 | using OpenSim.Framework; | 43 | using OpenSim.Framework; |
44 | using System.Diagnostics; | ||
45 | 44 | ||
46 | using OpenSim.Framework.Console; | 45 | using OpenSim.Framework.Console; |
47 | using OpenSim.Region.Framework.Interfaces; | 46 | using OpenSim.Region.Framework.Interfaces; |
@@ -143,21 +142,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
143 | internal float m_ScriptDistanceFactor = 1.0f; | 142 | internal float m_ScriptDistanceFactor = 1.0f; |
144 | internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >(); | 143 | internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >(); |
145 | 144 | ||
146 | /// <summary> | ||
147 | /// The timer used by the ScriptInstance to measure how long the script has executed. | ||
148 | /// </summary> | ||
149 | private Stopwatch m_executionTimer; | ||
150 | |||
151 | protected IUrlModule m_UrlModule = null; | 145 | protected IUrlModule m_UrlModule = null; |
152 | 146 | ||
153 | public void Initialize( | 147 | public void Initialize( |
154 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle, | 148 | IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle) |
155 | Stopwatch executionTimer) | ||
156 | { | 149 | { |
157 | m_ScriptEngine = scriptEngine; | 150 | m_ScriptEngine = scriptEngine; |
158 | m_host = host; | 151 | m_host = host; |
159 | m_item = item; | 152 | m_item = item; |
160 | m_executionTimer = executionTimer; | ||
161 | 153 | ||
162 | m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); | 154 | m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); |
163 | 155 | ||
@@ -440,19 +432,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
440 | delay = (int)((float)delay * m_ScriptDelayFactor); | 432 | delay = (int)((float)delay * m_ScriptDelayFactor); |
441 | if (delay == 0) | 433 | if (delay == 0) |
442 | return; | 434 | return; |
443 | 435 | System.Threading.Thread.Sleep(delay); | |
444 | if (m_executionTimer != null) | ||
445 | m_executionTimer.Stop(); // sleep time doesn't count as execution time, since it doesn't use the CPU | ||
446 | |||
447 | try | ||
448 | { | ||
449 | System.Threading.Thread.Sleep(delay); | ||
450 | } | ||
451 | finally | ||
452 | { | ||
453 | if (m_executionTimer != null) | ||
454 | m_executionTimer.Start(); | ||
455 | } | ||
456 | } | 436 | } |
457 | 437 | ||
458 | public LSL_Integer osSetTerrainHeight(int x, int y, double val) | 438 | public LSL_Integer osSetTerrainHeight(int x, int y, double val) |