NVIDIA Holoscan SDK v3.6.0

Class Clock

Base Types

Derived Types

class Clock : public holoscan::ClockInterface, public holoscan::gxf::GXFResource

GXF-based clock implementation.

This class wraps a GXF Clock component and implements the ClockInterface.

Subclassed by holoscan::ManualClock, holoscan::RealtimeClock, holoscan::SyntheticClock

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 Clock(ArgT &&arg, ArgsT&&... args)
Clock() = default
Clock(const std::string &name, nvidia::gxf::Clock *component)
inline virtual const char *gxf_typename() const override

The underlying GXF component’s name.

virtual double time() const override = 0

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

virtual int64_t timestamp() const override = 0

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

virtual void sleep_for(int64_t duration_ns) override = 0

Waits until the given duration has elapsed on the clock.

virtual void sleep_until(int64_t target_time_ns) override = 0

Waits until the given target time.

nvidia::gxf::Clock *get() const
virtual void sleep_for(int64_t duration_ns) = 0

Waits until the given duration has elapsed on the clock.

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

Set a duration to sleep.

Parameters

duration – The sleep duration of type std::chrono::duration.

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