Table of Contents

Class ClockedRunner

Namespace
Tlabs.Timing
Assembly
Tlabs.Core.dll

Utillity to invoke a delegate repeatingly with a given clock interval.

public sealed class ClockedRunner : IDisposable
Inheritance
ClockedRunner
Implements
Inherited Members
Extension Methods

Constructors

ClockedRunner(string, long, Func<CancellationToken, bool>, CancellationToken)

Ctor to start the clocked runner.

public ClockedRunner(string runnerTitle, long interval, Func<CancellationToken, bool> run, CancellationToken ctk = default)

Parameters

runnerTitle string

Diagnostic title of the runner

interval long

clocked run inteval in msec.

run Func<CancellationToken, bool>

delegate to run, takes ctk and indicates with a return value == true to abort further clocked invocations.

ctk CancellationToken

CancellationToken to cancel the clocked runner

Remarks

The called run delegate must return within interval msec. Failing to do so will result into a TimeoutException

Properties

ClockInterval

Clocked runner interval.

public long ClockInterval { get; }

Property Value

long

Title

Clocked runner title.

public string Title { get; }

Property Value

string

Methods

Dispose()

Stopps the clocked runner and release of all resources.

public void Dispose()