Class PreciseZonedClock
Represents a precise provider of ZonedDateTime instances.
public sealed class PreciseZonedClock : ZonedClockBase, IZonedClock, IGenerator<ZonedDateTime>, IGenerator- Inheritance
- 
      
      
      PreciseZonedClock
- Implements
- Inherited Members
- Extension Methods
Constructors
PreciseZonedClock(TimeZoneInfo)
Creates a new PreciseZonedClock instance with default PrecisionResetTimeout equal to 1 minute.
public PreciseZonedClock(TimeZoneInfo timeZone)Parameters
- timeZoneTimeZoneInfo
- Time zone of this clock. 
PreciseZonedClock(TimeZoneInfo, Duration)
Creates a new PreciseZonedClock instance.
public PreciseZonedClock(TimeZoneInfo timeZone, Duration precisionResetTimeout)Parameters
- timeZoneTimeZoneInfo
- Time zone of this clock. 
- precisionResetTimeoutDuration
- Precision reset timeout. See PrecisionResetTimeout for more information. 
Exceptions
- ArgumentOutOfRangeException
- When - precisionResetTimeoutis less than 1 tick.
Fields
Local
PreciseZonedClock instance that returns ZonedDateTime instances in the Local time zone, with PrecisionResetTimeout equal to 1 minute.
public static readonly PreciseZonedClock LocalField Value
Utc
PreciseZonedClock instance that returns ZonedDateTime instances in the Utc time zone, with PrecisionResetTimeout equal to 1 minute.
public static readonly PreciseZonedClock UtcField Value
Properties
PrecisionResetTimeout
Represents a reset timeout for the period of precise ZonedDateTime computation. After this period ends, the next returned ZonedDateTime instance will not use the underlying Stopwatch for improved precision and a new timeout will start.
public Duration PrecisionResetTimeout { get; }Property Value
Methods
GetNow()
Returns the current ZonedDateTime.
public override ZonedDateTime GetNow()Returns
- ZonedDateTime
- Current ZonedDateTime.