NVIDIA Holoscan SDK v3.6.0

Class SyntheticClock

Base Type

class SyntheticClock : public holoscan::gxf::Clock

Synthetic clock class.

A clock where time flow is synthesized, like from a recording or a simulation.

==Parameters==

  • initial_timestamp (int64_t): The initial timestamp on the clock (in nanoseconds) (default: 0.0).

Public Functions

template<typename ArgT, typename ...ArgsT, typename = std::enable_if_t<!std::is_base_of_v<::holoscan::Resource, std::decay_t<ArgT>> && (std::is_same_v<::holoscan::Arg, std::decay_t<ArgT>> || std::is_same_v<::holoscan::ArgList, std::decay_t<ArgT>>)>>
inline explicit SyntheticClock(ArgT &&arg, ArgsT&&... args)
SyntheticClock() = default
SyntheticClock(const std::string &name, nvidia::gxf::SyntheticClock *component)
inline virtual const char *gxf_typename() const override

The underlying GXF component’s name.

virtual void setup(ComponentSpec &spec)

Define the resource specification.

Parameters

spec – The reference to the component specification.

virtual double time() const override

The current time of the clock. Time is measured in seconds.

virtual int64_t timestamp() const override

The current timestamp of the clock. Timestamps are measured in nanoseconds.

virtual void sleep_for(int64_t duration_ns) override

Waits until the given duration has elapsed on the clock.

virtual void sleep_until(int64_t target_time_ns) override

Waits until the given target time.

void advance_to(int64_t new_time_ns)

Manually advance the clock to a desired new target time.

void advance_by(int64_t time_delta_ns)

Manually advance the clock by a given delta.

template<typename Rep, typename Period>
inline void advance_by(std::chrono::duration<Rep, Period> duration)

Set a duration to advance the clock by.

Parameters

duration – The std::chrono::duration to advance the clock by.

nvidia::gxf::SyntheticClock *get() const

Previous Class StreamOrderedAllocator
Next Class SystemResourceManager
© Copyright 2022-2025, NVIDIA. Last updated on Sep 4, 2025.