Function rcutils_system_time_now

Function Documentation

rcutils_ret_t rcutils_system_time_now(rcutils_time_point_value_t *now)

This function returns the time from a system clock. The closest equivalent would be to std::chrono::system_clock::now();

The resolution (e.g. nanoseconds vs microseconds) is not guaranteed.

The now argument must point to an allocated rcutils_time_point_value_t object, as the result is copied into this variable.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

Yes

Uses Atomics

No

Lock-Free

Yes

Parameters:

now[out] a datafield in which the current time is stored

Returns:

RCUTILS_RET_OK if the current time was successfully obtained, or

Returns:

RCUTILS_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCUTILS_RET_ERROR if an unspecified error occur.