Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    TimerTick Class

    Namespace: Stride.Games.Time
    Assembly: Stride.Games.dll

    This provides timing information similar to System.Diagnostics.Stopwatch but an update occurring only on a Tick() method.

    System.Object → TimerTick
    Derived from TimerTick:

    public class TimerTick
    Name Description
    Constructors
    TimerTick()

    Initializes a new instance of the TimerTick class.

    TimerTick(TimeSpan)

    Initializes a new instance of the TimerTick class.

    Properties
    ElapsedTime

    Gets the elapsed time since the previous call to Tick().

    ElapsedTimeWithPause

    Gets the elapsed time since the previous call to Tick() including Pause()

    IsPaused

    Gets a value indicating whether this instance is paused.

    SpeedFactor

    Gets or sets the speed factor. Default is 1.0

    StartTime

    Gets the start time when this timer was created.

    TotalTime

    Gets the total time elasped since the last reset or when this timer was created.

    TotalTimeWithPause

    Gets the total time elasped since the last reset or when this timer was created, including Pause()

    Methods
    Pause()

    Pauses this instance.

    Reset()

    Resets this instance. TotalTime is set to zero.

    Reset(TimeSpan)

    Resets this instance. TotalTime is set to startTime.

    Resume()

    Resumes this instance, only if a call to Pause() has been already issued.

    Tick()

    Update the TotalTime and ElapsedTime,

    | Improve this Doc View Source

    Constructors


    TimerTick()

    Initializes a new instance of the TimerTick class.

    public TimerTick()

    TimerTick(TimeSpan)

    Initializes a new instance of the TimerTick class.

    public TimerTick(TimeSpan startTime)
    Parameters
    Type Name Description
    System.TimeSpan startTime

    The start time.

    | Improve this Doc View Source

    Properties


    ElapsedTime

    Gets the elapsed time since the previous call to Tick().

    public TimeSpan ElapsedTime { get; }
    Property Value
    Type Description
    System.TimeSpan

    ElapsedTimeWithPause

    Gets the elapsed time since the previous call to Tick() including Pause()

    public TimeSpan ElapsedTimeWithPause { get; }
    Property Value
    Type Description
    System.TimeSpan

    IsPaused

    Gets a value indicating whether this instance is paused.

    public bool IsPaused { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is paused; otherwise, false.


    SpeedFactor

    Gets or sets the speed factor. Default is 1.0

    public double SpeedFactor { get; set; }
    Property Value
    Type Description
    System.Double

    The speed factor.


    StartTime

    Gets the start time when this timer was created.

    public TimeSpan StartTime { get; }
    Property Value
    Type Description
    System.TimeSpan

    TotalTime

    Gets the total time elasped since the last reset or when this timer was created.

    public TimeSpan TotalTime { get; }
    Property Value
    Type Description
    System.TimeSpan

    TotalTimeWithPause

    Gets the total time elasped since the last reset or when this timer was created, including Pause()

    public TimeSpan TotalTimeWithPause { get; }
    Property Value
    Type Description
    System.TimeSpan
    | Improve this Doc View Source

    Methods


    Pause()

    Pauses this instance.

    public void Pause()

    Reset()

    Resets this instance. TotalTime is set to zero.

    public void Reset()

    Reset(TimeSpan)

    Resets this instance. TotalTime is set to startTime.

    public void Reset(TimeSpan startTime)
    Parameters
    Type Name Description
    System.TimeSpan startTime

    The start time.


    Resume()

    Resumes this instance, only if a call to Pause() has been already issued.

    public void Resume()

    Tick()

    Update the TotalTime and ElapsedTime,

    public void Tick()
    Remarks

    This method must be called on a regular basis at every tick.


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation