6 [global::__DynamicallyInvokable]
9 private const long TicksPerMillisecond = 10000
L;
11 private const long TicksPerSecond = 10000000
L;
15 private long startTimeStamp;
17 private bool isRunning;
20 [global::__DynamicallyInvokable]
24 [global::__DynamicallyInvokable]
27 private static readonly
double tickFrequency;
32 [global::__DynamicallyInvokable]
35 [global::__DynamicallyInvokable]
44 [global::__DynamicallyInvokable]
47 [global::__DynamicallyInvokable]
50 return new TimeSpan(GetElapsedDateTimeTicks());
56 [global::__DynamicallyInvokable]
59 [global::__DynamicallyInvokable]
62 return GetElapsedDateTimeTicks() / 10000;
68 [global::__DynamicallyInvokable]
71 [global::__DynamicallyInvokable]
74 return GetRawElapsedTicks();
80 if (!Microsoft.Win32.SafeNativeMethods.QueryPerformanceFrequency(out
Frequency))
89 tickFrequency = 10000000.0;
95 [global::__DynamicallyInvokable]
102 [global::__DynamicallyInvokable]
114 [global::__DynamicallyInvokable]
123 [global::__DynamicallyInvokable]
129 long num = timestamp - startTimeStamp;
140 [global::__DynamicallyInvokable]
149 [global::__DynamicallyInvokable]
159 [global::__DynamicallyInvokable]
165 Microsoft.Win32.SafeNativeMethods.QueryPerformanceCounter(out value);
171 private long GetRawElapsedTicks()
177 long num2 = timestamp - startTimeStamp;
183 private long GetElapsedDateTimeTicks()
185 long rawElapsedTicks = GetRawElapsedTicks();
188 double num = rawElapsedTicks;
189 num *= tickFrequency;
192 return rawElapsedTicks;
Stopwatch()
Initializes a new instance of the T:System.Diagnostics.Stopwatch class.
Provides a set of methods and properties that you can use to accurately measure elapsed time....
void Restart()
Stops time interval measurement, resets the elapsed time to zero, and starts measuring elapsed time.
long ElapsedTicks
Gets the total elapsed time measured by the current instance, in timer ticks.
void Stop()
Stops measuring elapsed time for an interval.
long ElapsedMilliseconds
Gets the total elapsed time measured by the current instance, in milliseconds.
static Stopwatch StartNew()
Initializes a new T:System.Diagnostics.Stopwatch instance, sets the elapsed time property to zero,...
Represents an instant in time, typically expressed as a date and time of day. To browse the ....
static long GetTimestamp()
Gets the current number of ticks in the timer mechanism.
static readonly bool IsHighResolution
Indicates whether the timer is based on a high-resolution performance counter. This field is read-onl...
bool IsRunning
Gets a value indicating whether the T:System.Diagnostics.Stopwatch timer is running.
TimeSpan Elapsed
Gets the total elapsed time measured by the current instance.
static readonly long Frequency
Gets the frequency of the timer as the number of ticks per second. This field is read-only.
static DateTime UtcNow
Gets a T:System.DateTime object that is set to the current date and time on this computer,...
Represents a time interval.To browse the .NET Framework source code for this type,...
void Start()
Starts, or resumes, measuring elapsed time for an interval.
void Reset()
Stops time interval measurement and resets the elapsed time to zero.
long Ticks
Gets the number of ticks that represent the date and time of this instance.