rclcpp: Time
The rclcpp::Time and rclcpp::Duration are a significant departure from their ROS 1 equivalents, but are more closely related to std::chrono. For an in-depth discussion comparing with std::chrono, see this discussion on ROS Discourse.
When porting certain ROS 1 libraries, there may be significant usage of timestamps as floating-point seconds. To get floating point seconds from an _rclcpp::Time_:
There is no constructor for Time from seconds represented by a floating point, so you first need to convert to nanoseconds:
rclcpp::Duration does have functions to go both directions:
Unlike ROS 1, sleeping does NOT occur from a Duration instance: