Table of Contents

Class Timer

Namespace
Fantas
Assembly
Fantas.dll

Create timer helper

public sealed class Timer
Inheritance
Timer
Inherited Members

Properties

Elapsed

Elapsed time since timer started

public TimeSpan Elapsed { get; }

Property Value

TimeSpan

ElapsedSeconds

Elapsed seconds since timer started

public double ElapsedSeconds { get; }

Property Value

double

Name

Timer name

public string Name { get; }

Property Value

string

StopRequested

Mark timer to end

public bool StopRequested { get; }

Property Value

bool

Methods

CreatePeriodicTimer(string, double, Node, Action<Timer>)

Create a periodic timer that repeats forever

public static Timer CreatePeriodicTimer(string name, double interval, Node target, Action<Timer> tickAction)

Parameters

name string
interval double
target Node
tickAction Action<Timer>

Returns

Timer

CreatePeriodicTimer(string, TimeSpan, Node, Action<Timer>)

Create a periodic timer that repeats forever

public static Timer CreatePeriodicTimer(string name, TimeSpan interval, Node target, Action<Timer> tickAction)

Parameters

name string
interval TimeSpan
target Node
tickAction Action<Timer>

Returns

Timer

CreateRepeatedTimer(string, double, int, Node, Action<Timer>)

Create a periodic timer that repeats N times

public static Timer CreateRepeatedTimer(string name, double interval, int count, Node target, Action<Timer> tickAction)

Parameters

name string
interval double
count int
target Node
tickAction Action<Timer>

Returns

Timer

CreateRepeatedTimer(string, TimeSpan, int, Node, Action<Timer>)

Create a periodic timer that repeats N times

public static Timer CreateRepeatedTimer(string name, TimeSpan interval, int count, Node target, Action<Timer> tickAction)

Parameters

name string
interval TimeSpan
count int
target Node
tickAction Action<Timer>

Returns

Timer

CreateSingleTimer(string, double, Node, Action<Timer>)

Create a single trigger timer

public static Timer CreateSingleTimer(string name, double interval, Node target, Action<Timer> tickAction)

Parameters

name string
interval double
target Node
tickAction Action<Timer>

Returns

Timer

Exceptions

ArgumentNullException
ArgumentException

CreateSingleTimer(string, TimeSpan, Node, Action<Timer>)

Create a single trigger timer

public static Timer CreateSingleTimer(string name, TimeSpan interval, Node target, Action<Timer> tickAction)

Parameters

name string
interval TimeSpan
target Node
tickAction Action<Timer>

Returns

Timer

Exceptions

ArgumentNullException
ArgumentException

Stop()

Stop a repeated timer

public void Stop()