Class DefaultRenderTimer
Defines a default render timer that uses a standard timer.
[PrivateApi]
public class DefaultRenderTimer : IRenderTimer
- Inheritance
-
DefaultRenderTimer
- Implements
- Derived
- Inherited Members
Remarks
This class may be overridden by platform implementations to use a specialized timer implementation.
Constructors
DefaultRenderTimer(int)
Initializes a new instance of the DefaultRenderTimer class.
public DefaultRenderTimer(int framesPerSecond)
Parameters
framesPerSecond
intThe number of frames per second at which the loop should run.
Properties
FramesPerSecond
Gets the number of frames per second at which the loop runs.
public int FramesPerSecond { get; }
Property Value
RunsInBackground
Indicates if the timer ticks on a non-UI thread
public virtual bool RunsInBackground { get; }
Property Value
Methods
Start()
Starts the timer.
protected void Start()
StartCore(Action<TimeSpan>)
Provides the implementation of starting the timer.
protected virtual IDisposable StartCore(Action<TimeSpan> tick)
Parameters
Returns
Remarks
This can be overridden by platform implementations to use a specialized timer implementation.
Stop()
Stops the timer.
protected void Stop()
Events
Tick
Raised when the render timer ticks to signal a new frame should be drawn.
public event Action<TimeSpan> Tick
Event Type
Remarks
This event can be raised on any thread; it is the responsibility of the subscriber to switch execution to the right thread.