class

Duration(secondsopt, nanosecondsopt)

- Class representing a Duration in ROS

Constructor

class

new Duration(secondsopt, nanosecondsopt)

Create a Duration.
Parameters:
Name Type Attributes Default Description
seconds bigint <optional>
0 The second part of the duration.
nanoseconds bigint <optional>
0 The nanosecond part of the duration.
Source:

Methods

function

eq(other) → {boolean}

Determine whether two Duration objects are equal.
Parameters:
Name Type Description
other Duration The Duration object to be compared.
Source:
Returns:
Return true if they are equal.
Type boolean
function

get:nanoseconds() → {bigint}

Get the nanosecond part of the Duration.
Source:
Returns:
- value in nanosecond.
Type bigint
function

gt(other) → {boolean}

Determine whether the Duration object is greater than another one.
Parameters:
Name Type Description
other Duration The Duration object to be compared.
Source:
Returns:
Return true if it's greater than other.
Type boolean
function

gte(other) → {boolean}

Determine whether the Duration object is greater than or equal with another one.
Parameters:
Name Type Description
other Duration The Duration object to be compared.
Source:
Returns:
Return true if it's greater than or equal with other.
Type boolean
function

lt(other) → {boolean}

Determine whether the Duration object is less than another one.
Parameters:
Name Type Description
other Duration The Duration object to be compared.
Source:
Returns:
Return true if it's less than other.
Type boolean
function

lte(other) → {boolean}

Determine whether the Duration object is less than or equal with another one.
Parameters:
Name Type Description
other Duration The Duration object to be compared.
Source:
Returns:
Return true if it's less than or equal with other.
Type boolean
function

ne(other) → {boolean}

Determine whether two Duration objects are not equal.
Parameters:
Name Type Description
other Duration The Duration object to be compared.
Source:
Returns:
Return true if they are not equal.
Type boolean