Class CachingClock
Provides a IClock implementation that caches the result of another clock for short periods.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: TimeyWimey.Abstractions
Assembly: cs.temp.dll.dll
Syntax
public class CachingClock : SystemClock, IClock, IDisposable
Remarks
Some clock implementations may be allocation heavy or slow. Wrapping them in a caching clock can improve performance when finest precision is not required.
Constructors
Name | Description |
---|---|
CachingClock(IClock) | Creates an instance wrapping the IClock instance specified by |
CachingClock(IClock, Int32) | Creates an instance wrapping the IClock instance specified by |
Properties
Name | Description |
---|---|
Now | Returns the current time from the wrapped clock, or a cached time if insufficient time has passed since the inner clock was last consulted. |
Methods
Name | Description |
---|---|
Dispose() | Disconnects this clock from the inner clock's Adjusted event. |
Dispose(Boolean) | Disconnects this clock from the inner clock's Adjusted event. |