class eprosima::fastrtps::rtps::Time_t

Structure Time_t, used to describe times at RTPS protocol.

Public Functions


Default constructor. Sets values to zero.

Time_t(int32_t sec, uint32_t frac)

  • sec: Seconds

  • frac: Fraction of second

Time_t(long double sec)

  • sec: Seconds. The fractional part is converted to nanoseconds.

Time_t(const eprosima::fastrtps::Time_t &time)


int64_t to_ns() const

Returns stored time as nanoseconds (including seconds)

int32_t seconds() const

Retrieve the seconds field.

int32_t &seconds()

Retrieve the seconds field by ref.

void seconds(int32_t sec)

Sets seconds field.

uint32_t nanosec() const

Retrieve the nanosec field.

void nanosec(uint32_t nanos)

Sets nanoseconds field and updates the fraction.

uint32_t fraction() const

Retrieve the fraction field.

void fraction(uint32_t frac)

Sets fraction field and updates the nanoseconds.

Public Static Functions

void now(Time_t &ret)

Fills a Time_t struct with a representation of the current time.

  • ret: Reference to the structure to be filled in.