Main Content

seconds

Returns seconds of a time or duration

Since R2019b

Description

secs = seconds(time) returns the scalar number, secs, in seconds that represents the same value as the time object, time.

secs = seconds(duration) returns the scalar number, secs, in seconds that represents the same value as the duration object, duration.

Input Arguments

collapse all

ROS or system time, specified as a Time object handle. Create a Time object using rostime.

Duration, specified as a ROS Duration object with Sec and Nsec properties. Create a Duration object using rosduration.

Output Arguments

collapse all

Total time of the Time or Duration object, returned as a scalar in seconds.

Version History

Introduced in R2019b