Class: Duration

Duration(secondsopt, nanosecondsopt)

- Class representing a Duration in ROS

Constructor

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

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

get:nanoseconds() → {bigint}

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

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

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

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

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

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