Table of Contents

Class PreciseLocalDateTimeProvider

Namespace
LfrlAnvil.Chrono
Assembly
LfrlAnvil.Chrono.dll

Represents a precise provider of DateTime instances with Local kind.

public sealed class PreciseLocalDateTimeProvider : DateTimeProviderBase, IDateTimeProvider, IGenerator<DateTime>, IGenerator
Inheritance
PreciseLocalDateTimeProvider
Implements
Inherited Members

Constructors

PreciseLocalDateTimeProvider()

Creates a new PreciseLocalDateTimeProvider instance with default PrecisionResetTimeout equal to 1 minute.

public PreciseLocalDateTimeProvider()

PreciseLocalDateTimeProvider(Duration)

Creates a new PreciseLocalDateTimeProvider instance.

public PreciseLocalDateTimeProvider(Duration precisionResetTimeout)

Parameters

precisionResetTimeout Duration

Precision reset timeout. See PrecisionResetTimeout for more information.

Exceptions

ArgumentOutOfRangeException

When precisionResetTimeout is less than 1 tick.

Properties

PrecisionResetTimeout

Represents a reset timeout for the period of precise DateTime computation. After this period ends, the next returned DateTime 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 DateTime.

public override DateTime GetNow()

Returns

DateTime

Current DateTime.