rhodonite
    Preparing search index...

    Class Time

    A utility class for managing time-related operations and measurements. Provides functionality to track process timing, system uptime, and frame intervals.

    // Get current system uptime
    const uptime = Time.timeFromSystemStart;

    // Get last frame duration
    const frameTime = Time.lastTickTimeInterval;
    Index

    Constructors

    Accessors

    • get intervalProcessBegin(): number

      Gets the time interval between the start of consecutive process cycles.

      Returns number

      The interval between process beginnings in seconds

      This value indicates the time gap between when consecutive processing cycles started, which can be useful for measuring frame rate consistency.

    • get lastTickTimeInterval(): number

      Gets the duration of the last completed processing cycle.

      Returns number

      The last tick time interval in seconds

      This value represents the frame time or delta time, which is commonly used for frame-rate independent animations and physics calculations.

    • get lastTimeTimeIntervalInMilliseconds(): number

      Gets the duration of the last completed processing cycle in milliseconds.

      Returns number

      The last tick time interval in milliseconds

      This is the millisecond version of lastTickTimeInterval. Useful when higher precision timing is needed.

    • get timeAtProcessBeginMilliseconds(): number

      Gets the timestamp when the current process cycle began.

      Returns number

      The time in milliseconds when the current process began

    • get timeAtProcessEndMilliseconds(): number

      Gets the timestamp when the last process cycle ended.

      Returns number

      The time in milliseconds when the last process ended

    • get timeFromSystemStart(): number

      Gets the elapsed time since the system started.

      Returns number

      The elapsed time in seconds since system initialization

      This value represents the total uptime of the system and is useful for animations, timing calculations, and performance measurements.

    Methods

    • Internal

      Marks the beginning of a process cycle and updates timing measurements. This method should be called at the start of each frame or processing cycle.

      Returns void

      This method updates the current process begin time, calculates the interval since the last process began, and initializes the system start time if needed.

    • Internal

      Marks the end of a process cycle and calculates the processing duration. This method should be called at the end of each frame or processing cycle.

      Returns void

      This method records the process end time and calculates the duration of the current processing cycle (tick time interval).