Table of Contents

Class PreciseZonedClock

Namespace
LfrlAnvil.Chrono
Assembly
LfrlAnvil.Chrono.dll

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

timeZone TimeZoneInfo

Time zone of this clock.

PreciseZonedClock(TimeZoneInfo, Duration)

Creates a new PreciseZonedClock instance.

public PreciseZonedClock(TimeZoneInfo timeZone, Duration precisionResetTimeout)

Parameters

timeZone TimeZoneInfo

Time zone of this clock.

precisionResetTimeout Duration

Precision reset timeout. See PrecisionResetTimeout for more information.

Exceptions

ArgumentOutOfRangeException

When precisionResetTimeout is 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 Local

Field Value

PreciseZonedClock

Utc

PreciseZonedClock instance that returns ZonedDateTime instances in the Utc time zone, with PrecisionResetTimeout equal to 1 minute.

public static readonly PreciseZonedClock Utc

Field Value

PreciseZonedClock

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

Duration

Methods

GetNow()

Returns the current ZonedDateTime.

public override ZonedDateTime GetNow()

Returns

ZonedDateTime

Current ZonedDateTime.