NVIDIA Holoscan SDK v2.4.0
Holoscan v2.4.0

Class RealtimeClock

class RealtimeClock : public holoscan::Clock

Real-time clock class.

The RealtimeClock respects the true duration of conditions such as <a class="reference internal" href="classholoscan_1_1PeriodicCondition.html#classholoscan_1_1PeriodicCondition" target="_self">PeriodicCondition</a>. It is the default clock type used in Holoscan SDK.

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 RealtimeClock(ArgT &&arg, ArgsT&&... args)
RealtimeClock() = default
RealtimeClock(const std::string &name, nvidia::gxf::RealtimeClock *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 set_time_scale(double time_scale)

Set the time scale of the clock. A value of 1.0 corresponds to realtime. Values larger than 1.0 cause time to run faster, while values less than 1.0 cause time to run more slowly.

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

Previous Class PeriodicCondition
Next Class Receiver
© Copyright 2022-2024, NVIDIA. Last updated on Oct 1, 2024.