Skip to content

Commit 524ddee

Browse files
committed
Proper rounding to the closest nanosecond
1 parent 515612d commit 524ddee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rerun_cpp/src/rerun/recording_stream.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ namespace rerun {
274274
/// You can remove a timeline from subsequent log calls again using `rec.disable_timeline`.
275275
/// @see set_index_sequence, set_index_duration, set_index_duration_secs, set_index_duration_nanos, set_index_timestamp, set_index_timestamp_seconds_since_epoch, set_index_timestamp_nanos_since_epoch
276276
void set_index_duration_secs(std::string_view timeline_name, double secs) const {
277-
set_index_duration_nanos(timeline_name, static_cast<int64_t>(1e9 * secs));
277+
set_index_duration_nanos(timeline_name, static_cast<int64_t>(1e9 * secs + 0.5));
278278
}
279279

280280
/// Set the index value of the given timeline as a duration in nanoseconds, for the current calling thread.

0 commit comments

Comments
 (0)