> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sdk-user-guide/_mcp/server.

# holoscan::ClockInterface

> Pure interface defining clock functionality.

Pure interface defining clock functionality.

This interface defines the core clock operations that all clock implementations must provide.

```cpp showLineNumbers={false}
#include <holoscan/clock.hpp>
```

---

## Constructors

### Destructor \[#destructor]

### \~ClockInterface

```cpp showLineNumbers={false}
virtual holoscan::ClockInterface::~ClockInterface() = default
```

---

## Methods

### time \[#time]

```cpp showLineNumbers={false}
virtual double holoscan::ClockInterface::time() const
```

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

### timestamp \[#timestamp]

```cpp showLineNumbers={false}
virtual int64_t holoscan::ClockInterface::timestamp() const
```

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

### sleep\_for \[#sleepfor]

#### Overload 1

virtual

```cpp showLineNumbers={false}
virtual void holoscan::ClockInterface::sleep_for(
    int64_t duration_ns
)
```

Waits until the given duration has elapsed on the clock.

#### Set a duration to sleep

inline

```cpp showLineNumbers={false}
template <typename Rep, typename Period>
void holoscan::ClockInterface::sleep_for(
    std::chrono::duration<Rep, Period> duration
)
```

Set a duration to sleep.

**Parameters**

**`duration`** `std::chrono::duration<Rep, Period>`

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

---

### sleep\_until \[#sleepuntil]

```cpp showLineNumbers={false}
virtual void holoscan::ClockInterface::sleep_until(
    int64_t target_time_ns
)
```

Waits until the given target time.