float Absolute { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Absolute property of the TimeSince struct represents the exact time at which the timer was last reset. This value is based on the current time as provided by Sandbox.Time.Now. It is useful for determining the specific moment an event occurred or was reset.

Usage

Use the Absolute property when you need to know the exact time of the last reset event. This can be particularly useful for logging or debugging purposes where precise timing is required.

Example

// Example of using TimeSince and accessing the Absolute property
TimeSince lastActionTime = 0;

// Simulate some action
if ( lastActionTime > 5 )
{
    // Perform an action if more than 5 seconds have passed since last reset
    DoSomething();
    
    // Reset the timer
    lastActionTime = 0;
}

// Access the Absolute time of the last reset
float resetTime = lastActionTime.Absolute;
Console.WriteLine($"The timer was last reset at: {resetTime}");