Class GorgonTimerQpc
An implementation of the IGorgonTimer interface.
Implements
Inherited Members
Namespace: Gorgon.Timing
Assembly: Gorgon.Windows.dll
Syntax
public sealed class GorgonTimerQpc : IGorgonTimer
Remarks
This implementation uses the Query Performance Counter. It provides accuracy of 1 microsecond.
caution
Issues
On older processors this functionality may not be supported at all. If Gorgon can't detect support for this type of timer, it will throw an exception. In order to avoid this, use the SupportsQpc() static method on this class to determine if the system will support the timer. This should not be an issue with a reasonably modern system.
This is an issue on systems with Windows versions before Windows Vista because multi-core systems may not report the correct time stamp. Since Gorgon requires Windows 10 at minimum, this should not be an issue.
There may be a performance hit using this timer, depending on your operating system version and hardware.
For a comprehensive overview of the Qpc timer, go to https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx.
Properties
| Edit this page View SourceDays
Property to return the number of days elapsed since the timer was started.
Declaration
public double Days { get; }
Property Value
Type | Description |
---|---|
double |
Hours
Property to return the number of hours elapsed since the timer was started.
Declaration
public double Hours { get; }
Property Value
Type | Description |
---|---|
double |
IsHighResolution
Property to return whether this timer has a resolution of less than 1 millisecond or not.
Declaration
public bool IsHighResolution { get; }
Property Value
Type | Description |
---|---|
bool |
Microseconds
Property to return the number of microseconds elapsed since the timer was started.
Declaration
public double Microseconds { get; }
Property Value
Type | Description |
---|---|
double |
Milliseconds
Property to return the number of milliseconds elapsed since the timer was started.
Declaration
public double Milliseconds { get; }
Property Value
Type | Description |
---|---|
double |
Minutes
Property to return the number of minutes elapsed since the timer was started.
Declaration
public double Minutes { get; }
Property Value
Type | Description |
---|---|
double |
Seconds
Property to return the number of seconds elapsed since the timer was started.
Declaration
public double Seconds { get; }
Property Value
Type | Description |
---|---|
double |
Ticks
Property to return the number of ticks since the timer was started.
Declaration
public long Ticks { get; }
Property Value
Type | Description |
---|---|
long |
Methods
| Edit this page View SourceReset()
Function to reset the timer.
Declaration
public void Reset()
SupportsQpc()
Function to return whether the system supports the query performance counter.
Declaration
public static bool SupportsQpc()
Returns
Type | Description |
---|---|
bool | true if the system supports the timer, false if it does not. |