Class RealTimeClock
A time measurement artifact.
Implements
Inherited Members
Namespace: Swan.Diagnostics
Syntax
public sealed class RealTimeClock : IDisposable
Constructors
RealTimeClock()
Initializes a new instance of the RealTimeClock class. The clock starts paused and at the 0 position.
Declaration
public RealTimeClock()
Properties
IsRunning
Gets a value indicating whether the clock is running.
Declaration
public bool IsRunning { get; }
Property Value
Type | Description |
---|---|
Boolean |
Position
Gets or sets the clock position.
Declaration
public TimeSpan Position { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
SpeedRatio
Gets or sets the speed ratio at which the clock runs.
Declaration
public double SpeedRatio { get; set; }
Property Value
Type | Description |
---|---|
Double |
Methods
Dispose()
Declaration
public void Dispose()
Pause()
Pauses the clock.
Declaration
public void Pause()
Play()
Starts or resumes the clock.
Declaration
public void Play()
Reset()
Sets the clock position to 0 and stops it. The speed ratio is not modified.
Declaration
public void Reset()
Update(TimeSpan)
Sets a new position value atomically.
Declaration
public void Update(TimeSpan value)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | value | The new value that the position property will hold. |