diff options
author | Sean Dague | 2007-07-16 15:40:11 +0000 |
---|---|---|
committer | Sean Dague | 2007-07-16 15:40:11 +0000 |
commit | 2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6 (patch) | |
tree | e3f80ad51736cf17e856547b1bcf956010927434 /OpenSim/Region/Examples/SimpleApp/MySceneObject.cs | |
parent | *Trunk compiles now (diff) | |
download | opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.zip opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.gz opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.bz2 opensim-SC-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.xz |
changed to native line ending encoding
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/MySceneObject.cs | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs b/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs index aab52cc..f5c6a0f 100644 --- a/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs +++ b/OpenSim/Region/Examples/SimpleApp/MySceneObject.cs | |||
@@ -1,40 +1,40 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using OpenSim.Region.Environment.Scenes; | 4 | using OpenSim.Region.Environment.Scenes; |
5 | using libsecondlife; | 5 | using libsecondlife; |
6 | using OpenSim.Framework.Types; | 6 | using OpenSim.Framework.Types; |
7 | using System.Timers; | 7 | using System.Timers; |
8 | using System.Diagnostics; | 8 | using System.Diagnostics; |
9 | 9 | ||
10 | namespace SimpleApp | 10 | namespace SimpleApp |
11 | { | 11 | { |
12 | public class MySceneObject : SceneObject | 12 | public class MySceneObject : SceneObject |
13 | { | 13 | { |
14 | private PerformanceCounter m_counter; | 14 | private PerformanceCounter m_counter; |
15 | 15 | ||
16 | public MySceneObject(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) | 16 | public MySceneObject(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) |
17 | : base(world, eventManager, ownerID, localID, pos, shape ) | 17 | : base(world, eventManager, ownerID, localID, pos, shape ) |
18 | { | 18 | { |
19 | String objectName = "Processor"; | 19 | String objectName = "Processor"; |
20 | String counterName = "% Processor Time"; | 20 | String counterName = "% Processor Time"; |
21 | String instanceName = "_Total"; | 21 | String instanceName = "_Total"; |
22 | 22 | ||
23 | m_counter = new PerformanceCounter(objectName, counterName, instanceName); | 23 | m_counter = new PerformanceCounter(objectName, counterName, instanceName); |
24 | 24 | ||
25 | Timer timer = new Timer(); | 25 | Timer timer = new Timer(); |
26 | timer.Enabled = true; | 26 | timer.Enabled = true; |
27 | timer.Interval = 100; | 27 | timer.Interval = 100; |
28 | timer.Elapsed += new ElapsedEventHandler(this.Heartbeat); | 28 | timer.Elapsed += new ElapsedEventHandler(this.Heartbeat); |
29 | 29 | ||
30 | } | 30 | } |
31 | 31 | ||
32 | public void Heartbeat(object sender, EventArgs e) | 32 | public void Heartbeat(object sender, EventArgs e) |
33 | { | 33 | { |
34 | float cpu = m_counter.NextValue() / 40f; | 34 | float cpu = m_counter.NextValue() / 40f; |
35 | LLVector3 size = new LLVector3(cpu, cpu, cpu); | 35 | LLVector3 size = new LLVector3(cpu, cpu, cpu); |
36 | rootPrimitive.ResizeGoup( size ); | 36 | rootPrimitive.ResizeGoup( size ); |
37 | update(); | 37 | update(); |
38 | } | 38 | } |
39 | } | 39 | } |
40 | } | 40 | } |