Class ClockExtensions
Provides a set of extension methods for clocks.
Inheritance
System.Object
ClockExtensions
Namespace: System.Time
Assembly: Nuqleon.Time.dll
Syntax
public static class ClockExtensions : Object
Methods
AssertMonotonic(IClock)
Asserts that the specified clock is monotonic. When the resulting clock's time is read and it is less than the previous time reading, an exception is thrown.
Declaration
public static IClock AssertMonotonic(this IClock clock)
Parameters
| Type | Name | Description |
|---|---|---|
| IClock | clock | The clock to assert monotonicity for. |
Returns
| Type | Description |
|---|---|
| IClock | A clock instance that asserts monotonicity of the specified clock. |
EnsureMonotonic(IClock)
Ensures that the specified clock is monotonic. When the resulting clock's time is read and it is less than the previous time reading, the previous reading is used.
Declaration
public static IClock EnsureMonotonic(this IClock clock)
Parameters
| Type | Name | Description |
|---|---|---|
| IClock | clock | The clock to ensure monotonicity for. |
Returns
| Type | Description |
|---|---|
| IClock | A clock instance that ensure monotonicity of the specified clock. |