The Time
property of the Connection
class represents the amount of time, in seconds, that has elapsed since the connection was established. This property is useful for tracking the duration of a connection session.
The Time
property of the Connection
class represents the amount of time, in seconds, that has elapsed since the connection was established. This property is useful for tracking the duration of a connection session.
To access the Time
property, you need an instance of the Connection
class. This property is read-only and provides a float
value representing the elapsed time in seconds.
// Example of accessing the Time property Connection connection = Connection.Find(someGuid); float elapsedTime = connection.Time; // Output the elapsed time // Note: Avoid using Console.WriteLine in Sandbox Log.Info($"Connection has been active for {elapsedTime} seconds.");