diff options
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r-- | OpenSim/Framework/Util.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index ed24452..a42dcc6 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -156,12 +156,14 @@ namespace OpenSim.Framework | |||
156 | public static readonly int MAX_THREADPOOL_LEVEL = 3; | 156 | public static readonly int MAX_THREADPOOL_LEVEL = 3; |
157 | 157 | ||
158 | public static double TimeStampClockPeriodMS; | 158 | public static double TimeStampClockPeriodMS; |
159 | public static double TimeStampClockPeriod; | ||
159 | 160 | ||
160 | static Util() | 161 | static Util() |
161 | { | 162 | { |
162 | LogThreadPool = 0; | 163 | LogThreadPool = 0; |
163 | LogOverloads = true; | 164 | LogOverloads = true; |
164 | TimeStampClockPeriodMS = 1000.0D / (double)Stopwatch.Frequency; | 165 | TimeStampClockPeriod = 1.0D/ (double)Stopwatch.Frequency; |
166 | TimeStampClockPeriodMS = 1e3 * TimeStampClockPeriod; | ||
165 | m_log.InfoFormat("[UTIL] TimeStamp clock with period of {0}ms", Math.Round(TimeStampClockPeriodMS,6,MidpointRounding.AwayFromZero)); | 167 | m_log.InfoFormat("[UTIL] TimeStamp clock with period of {0}ms", Math.Round(TimeStampClockPeriodMS,6,MidpointRounding.AwayFromZero)); |
166 | } | 168 | } |
167 | 169 | ||
@@ -3016,6 +3018,11 @@ namespace OpenSim.Framework | |||
3016 | 3018 | ||
3017 | // returns a timestamp in ms as double | 3019 | // returns a timestamp in ms as double |
3018 | // using the time resolution avaiable to StopWatch | 3020 | // using the time resolution avaiable to StopWatch |
3021 | public static double GetTimeStamp() | ||
3022 | { | ||
3023 | return (double)Stopwatch.GetTimestamp() * TimeStampClockPeriod; | ||
3024 | } | ||
3025 | |||
3019 | public static double GetTimeStampMS() | 3026 | public static double GetTimeStampMS() |
3020 | { | 3027 | { |
3021 | return (double)Stopwatch.GetTimestamp() * TimeStampClockPeriodMS; | 3028 | return (double)Stopwatch.GetTimestamp() * TimeStampClockPeriodMS; |