Skip to main content

Run Method

Starts a new timer.

Definition

Namespace: Avalonia.Threading
Assembly: Avalonia.Base (in Avalonia.Base.dll)

public static IDisposable Run(
Func<bool> action,
TimeSpan interval,
DispatcherPriority priority = default
)

Parameters

  Func(Boolean)
The method to call on timer tick. If the method returns false, the timer will stop.
  TimeSpan
The interval at which to tick.
  DispatcherPriority  (Optional)
The priority to use.

Return Value

IDisposable
An IDisposable used to cancel the timer.

See Also

Reference

DispatcherTimer Class
Avalonia.Threading Namespace