struct TimeSince

book_4_sparkGenerated
code_blocksInput

Description

The TimeSince struct in the Sandbox namespace is a utility for measuring the time elapsed since a particular event. It is based on the current time as provided by Time.Now. This struct is particularly useful for scenarios where you need to track the duration since an event occurred, such as cooldowns or timeouts.

To use TimeSince, you typically initialize it to zero to reset the timer. The struct then provides the elapsed time since the last reset. For example:

TimeSince lastUsed = 0;
if ( lastUsed > 10 ) {
    // Do something
}

Members

Instance Properties

Member NameSummary
AbsoluteTime at which the timer reset happened, based on Time.Now.
RelativeTime passed since last reset, in seconds.