TimeSinceclass

A convenience struct to easily measure time since an event last happened, based on `Sandbox.Time.Now`. Typical usage would see you assigning 0 to a variable of this type to reset the timer. Then the struct would return time since the last reset. i.e.: TimeSince lastUsed = 0; if ( lastUsed > 10 ) { /*Do something*/ }

objectTimeSince
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public sealed struct Sandbox.TimeSince

Properties2

Showing 2 properties

public float Sandbox.TimeSince.Absolute { get; set; }PUBLICGETSET

Time at which the timer reset happened, based on `Sandbox.Time.Now`.

Returns:float

public float Sandbox.TimeSince.Relative { get; set; }PUBLICGETSET

Time passed since last reset, in seconds.

Returns:float

On this page