Skip to content

Timeline functions

rerun

def set_time(timeline, *, recording=None, sequence=None, duration=None, timestamp=None)

Set the current time of a timeline for this thread.

Used for all subsequent logging on the same thread, until the next call to rerun.set_time, rerun.reset_time or rerun.disable_timeline.

For example: set_time("frame_nr", sequence=frame_nr).

There is no requirement of monotonicity. You can move the time backwards if you like.

You are expected to set exactly ONE of the arguments sequence, duration, or timestamp. You may NOT change the type of a timeline, so if you use duration for a specific timeline, you must only use duration for that timeline going forward.

The columnar equivalent to this function is rerun.TimeColumn.

PARAMETER DESCRIPTION
timeline

The name of the timeline to set the time for.

TYPE: str

recording

Specifies the rerun.RecordingStream to use. If left unspecified, defaults to the current active data recording (if there is one). See also: rerun.init, rerun.set_global_data_recording.

TYPE: RecordingStream | None DEFAULT: None

sequence

Used for sequential indices, like frame_nr. Must be an integer.

TYPE: int | None DEFAULT: None

duration

Used for relative times, like time_since_start. Must either be in seconds, a datetime.timedelta, or numpy.timedelta64. For nanosecond precision, use numpy.timedelta64(nanoseconds, 'ns').

TYPE: int | float | timedelta | timedelta64 | None DEFAULT: None

timestamp

Used for absolute time indices, like capture_time. Must either be in seconds since Unix epoch, a datetime.datetime, or numpy.datetime64. For nanosecond precision, use numpy.datetime64(nanoseconds, 'ns').

TYPE: int | float | datetime | datetime64 | None DEFAULT: None

def set_time_sequence(timeline, sequence, recording=None)

DEPRECATED: Set the current time for this thread as an integer sequence.

Used for all subsequent logging on the same thread, until the next call to set_time_sequence.

For example: set_time_sequence("frame_nr", frame_nr).

You can remove a timeline again using disable_timeline("frame_nr").

There is no requirement of monotonicity. You can move the time backwards if you like.

This function marks the timeline as being of a squential type. You should not use the temporal functions (rerun.set_time_seconds, rerun.set_time_nanos) on the same timeline, as that will produce undefined behavior.

PARAMETER DESCRIPTION
timeline

The name of the timeline to set the time for.

TYPE: str

sequence

The current time on the timeline in integer units.

TYPE: int

recording

Specifies the rerun.RecordingStream to use. If left unspecified, defaults to the current active data recording, if there is one. See also: rerun.init, rerun.set_global_data_recording.

TYPE: RecordingStream | None DEFAULT: None

def set_time_seconds(timeline, seconds, recording=None)

DEPRECATED: Set the current time for this thread in seconds.

Used for all subsequent logging on the same thread, until the next call to rerun.set_time_seconds or rerun.set_time_nanos.

For example: set_time_seconds("capture_time", seconds_since_unix_epoch).

You can remove a timeline again using disable_timeline("capture_time").

Very large values will automatically be interpreted as seconds since unix epoch (1970-01-01). Small values (less than a few years) will be interpreted as relative some unknown point in time, and will be shown as e.g. +3.132s.

The bindings has a built-in time which is log_time, and is logged as seconds since unix epoch.

There is no requirement of monotonicity. You can move the time backwards if you like.

This function marks the timeline as being of a temporal type. You should not use the sequential function rerun.set_time_sequence on the same timeline, as that will produce undefined behavior.

PARAMETER DESCRIPTION
timeline

The name of the timeline to set the time for.

TYPE: str

seconds

The current time on the timeline in seconds.

TYPE: float

recording

Specifies the rerun.RecordingStream to use. If left unspecified, defaults to the current active data recording, if there is one. See also: rerun.init, rerun.set_global_data_recording.

TYPE: RecordingStream | None DEFAULT: None

def set_time_nanos(timeline, nanos, recording=None)

DEPRECATED: Set the current time for this thread.

Used for all subsequent logging on the same thread, until the next call to rerun.set_time_nanos or rerun.set_time_seconds.

For example: set_time_nanos("capture_time", nanos_since_unix_epoch).

You can remove a timeline again using disable_timeline("capture_time").

Very large values will automatically be interpreted as nanoseconds since unix epoch (1970-01-01). Small values (less than a few years) will be interpreted as relative some unknown point in time, and will be shown as e.g. +3.132s.

The bindings has a built-in time which is log_time, and is logged as nanos since unix epoch.

There is no requirement of monotonicity. You can move the time backwards if you like.

This function marks the timeline as being of a temporal type. You should not use the sequential function rerun.set_time_sequence on the same timeline, as that will produce undefined behavior.

PARAMETER DESCRIPTION
timeline

The name of the timeline to set the time for.

TYPE: str

nanos

The current time on the timeline in nanoseconds.

TYPE: int

recording

Specifies the rerun.RecordingStream to use. If left unspecified, defaults to the current active data recording, if there is one. See also: rerun.init, rerun.set_global_data_recording.

TYPE: RecordingStream | None DEFAULT: None

def disable_timeline(timeline, recording=None)

Clear time information for the specified timeline on this thread.

PARAMETER DESCRIPTION
timeline

The name of the timeline to clear the time for.

TYPE: str

recording

Specifies the rerun.RecordingStream to use. If left unspecified, defaults to the current active data recording, if there is one. See also: rerun.init, rerun.set_global_data_recording.

TYPE: RecordingStream | None DEFAULT: None

def reset_time(recording=None)

Clear all timeline information on this thread.

This is the same as calling disable_timeline for all of the active timelines.

Used for all subsequent logging on the same thread, until the next call to rerun.set_time_nanos or rerun.set_time_seconds.

PARAMETER DESCRIPTION
recording

Specifies the rerun.RecordingStream to use. If left unspecified, defaults to the current active data recording, if there is one. See also: rerun.init, rerun.set_global_data_recording.

TYPE: RecordingStream | None DEFAULT: None