duration QML Value Type
Duration defines a period between two time points. More...
| Import Statement: | import QtRos2.BuiltinInterfaces |
| Status: | Experimental Extension |
Properties
Detailed Description
Messages of this datatype are of ROS Time following this design: https://design.ros2.org/articles/clock_and_time.html
duration is a structured value type usable in QML. It maps directly to the builtin_interfaces::msg::Duration ROS 2 message type.
Construct a duration in QML by assigning a JavaScript object whose keys are its component properties, or by setting those properties individually.
See also DurationPublisher and DurationSubscriber.
Property Documentation
nanosec : uint32_t
The nanoseconds component, valid in the range [0, 1e9), to be added to the seconds component.
e.g. The duration -1.7 seconds is represented as {sec: -2, nanosec: 3e8} The duration 1.7 seconds is represented as {sec: 1, nanosec: 7e8}
sec : int32_t
The seconds component, valid over all int32 values.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.