logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface ITimer

    Interface representing a timer component with various time management functionalities.

    Namespace: Serenity.Timer.Application.Interfaces
    Assembly: Serenity.Timer.Application.dll
    Syntax
    public interface ITimer : IComponent, IFoundationSettings

    Methods

    GetHours()

    Gets the current hours of the timer.

    Declaration
    int GetHours()
    Returns
    Type Description
    int

    GetMinutes()

    Gets the current minutes of the timer.

    Declaration
    int GetMinutes()
    Returns
    Type Description
    int

    The current minutes of the timer.

    GetSeconds()

    Gets the current seconds of the timer.

    Declaration
    float GetSeconds()
    Returns
    Type Description
    float

    The current seconds of the timer.

    GetTimeInSeconds()

    Gets the total time of the timer in seconds.

    Declaration
    float GetTimeInSeconds()
    Returns
    Type Description
    float

    The total time of the timer in seconds.

    InitializeTimer()

    Initializes the timer component.

    Declaration
    void InitializeTimer()

    IsRunning()

    Checks if the timer is currently running.

    Declaration
    bool IsRunning()
    Returns
    Type Description
    bool

    True if the timer is running; otherwise, false.

    SetHours(int)

    Sets the hours for the timer.

    Declaration
    void SetHours(int value)
    Parameters
    Type Name Description
    int value

    The hours to set.

    SetMinutes(int)

    Sets the minutes for the timer.

    Declaration
    void SetMinutes(int value)
    Parameters
    Type Name Description
    int value

    The minutes to set.

    SetSeconds(float)

    Sets the seconds for the timer.

    Declaration
    void SetSeconds(float value)
    Parameters
    Type Name Description
    float value

    The seconds to set.

    SetTimer(int, int, float)

    Sets the timer duration.

    Declaration
    void SetTimer(int hours, int minutes, float seconds)
    Parameters
    Type Name Description
    int hours

    The hours to set.

    int minutes

    The minutes to set.

    float seconds

    The seconds to set.

    SetTimer(float)

    Sets the timer duration in seconds.

    Declaration
    void SetTimer(float seconds)
    Parameters
    Type Name Description
    float seconds

    The total seconds to set.

    StartTimer()

    Starts or resumes the timer.

    Declaration
    void StartTimer()

    StopTimer()

    Stops the timer.

    Declaration
    void StopTimer()

    Tick(float)

    Advances the timer by the given delta. Called centrally by the timer service.

    Declaration
    void Tick(float deltaSeconds)
    Parameters
    Type Name Description
    float deltaSeconds

    The time delta in seconds to apply.

    In this article
    © 2026 Serenity. All Rights Reserved