Interface IClock
Interface for components that can return the 'current time'.
Namespace: TimeyWimey.Abstractions
Assembly: cs.temp.dll.dll
Syntax
public interface IClock
Remarks
By using an abstraction rather than directly accessing a method like System.DateTime.Now you can better implement date/time based tests. You can also potentially change implementations between a regular system clock, an NTP adjusted, a clock with a manual offset or a clock reduces allocations when the time is requested (see CachingClock).
Properties
Name | Description |
---|---|
Now | Returns the current time as a System.DateTimeOffset. |
Events
Name | Description |
---|---|
Adjusted | Occurs when the clock has been adjusted or signficantly altered, such as when the user sets the time or the time is synced to a server, but not on regular 'ticks' of the clock. |