Skip to content

Stopwatch

eisclimber edited this page Feb 11, 2024 · 2 revisions

Stopwatch

class in ExPresSXR.Misc.Timing / Extends MonoBehavior
Component added via Component Menu

Description

A simple component to stop the time like a stopwatch.

Members

Public Properties

  • float startTime: (Readonly) Time when the stopwatch was started or INACTIVE_STOP_TIME if not started.
  • float currentStopTime: (Readonly) How long the stopwatch is currently running or INACTIVE_STOP_TIME if not started.
  • bool autoStart: If true, will start the timer during OnAwake().
  • bool running: Is true if the stopwatch is currently measuring time.

Public Methods

  • void StartTimeMeasurement(): Starts a time measurement with the stopwatch. Only updates the startTime when already running.
  • string StopTimeMeasurement(bool _restart = false): Stops and resets the stopwatch, returns the final time measurement in seconds.

Constants

  • float INACTIVE_STOP_TIME = -1.0f: Returned by currentStopTime if he stopwatch was not started yet.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally