SimpleTimer Struct

Summary

A very simple timer system based on a System.Diagnostics.Stopwatch.
Assembly
UltEvents.dll
Namespace
UltEvents
Interfaces
  • IDisposable
Base Types
  • ValueType
graph BT Type-->Base0["ValueType"] Type-.->Interface0["IDisposable"] Type["SimpleTimer"] class Type type-node

Syntax

public struct SimpleTimer : ValueType, IDisposable

Constructors

Name Summary
SimpleTimer(string) Creates a new UltEvents.SimpleTimer with the specified `name`.

Fields

Name Constant Value Summary
name
An optional prefix for UltEvents.SimpleTimer.ToString.
startTime
The UltEvents.SimpleTimer.CurrentTime from when this timer instance was started.
Stopwatch
The system used to track time.
static
total
The total amount of time this timer instance has been running (in seconds).

Properties

Name Value Summary
CurrentTime double
The amount of time that has passed (in seconds) since the first timer was started.
static
IsStarted bool
Has UltEvents.SimpleTimer.Start been called and UltEvents.SimpleTimer.Stop not?

Methods

Name Value Summary
Dispose() void
Calls UltEvents.SimpleTimer.ToString and logs the result.
Start() bool
Stores the UltEvents.SimpleTimer.CurrentTime in UltEvents.SimpleTimer.startTime so that UltEvents.SimpleTimer.Stop will be able to calculate how much time has passed.
Start(string) SimpleTimer
Creates a new UltEvents.SimpleTimer with the specified `name` and starts it.
static
Stop() bool
Adds the amount of time that has passed since the UltEvents.SimpleTimer.startTime to the UltEvents.SimpleTimer.total and clears the UltEvents.SimpleTimer.startTime.
ToString() string
Calls UltEvents.SimpleTimer.Stop and returns a string representation of the UltEvents.SimpleTimer.total.