aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Util.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 77985bd..d1cdaa6 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -140,10 +140,14 @@ namespace OpenSim.Framework
140 140
141 public static readonly int MAX_THREADPOOL_LEVEL = 3; 141 public static readonly int MAX_THREADPOOL_LEVEL = 3;
142 142
143 public static double TimeStampClockPeriodMS;
144
143 static Util() 145 static Util()
144 { 146 {
145 LogThreadPool = 0; 147 LogThreadPool = 0;
146 LogOverloads = true; 148 LogOverloads = true;
149 TimeStampClockPeriodMS = 1000.0D / (double)Stopwatch.Frequency;
150 m_log.InfoFormat("[UTIL] TimeStamp clock with period of {0}ms", Math.Round(TimeStampClockPeriodMS,6,MidpointRounding.AwayFromZero));
147 } 151 }
148 152
149 private static uint nextXferID = 5000; 153 private static uint nextXferID = 5000;
@@ -2662,6 +2666,13 @@ namespace OpenSim.Framework
2662 return tcA - tcB; 2666 return tcA - tcB;
2663 } 2667 }
2664 2668
2669 // returns a timestamp in ms as double
2670 // using the time resolution avaiable to StopWatch
2671 public static double GetTimeStampMS()
2672 {
2673 return (double)Stopwatch.GetTimestamp() * TimeStampClockPeriodMS;
2674 }
2675
2665 /// <summary> 2676 /// <summary>
2666 /// Formats a duration (given in milliseconds). 2677 /// Formats a duration (given in milliseconds).
2667 /// </summary> 2678 /// </summary>