---
name: "mlx5dv_ts_to_ns"
section: "3"
platform: "linux"
package: "rdma-core"
version: "65.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/mlx5dv_ts_to_ns"
---

# mlx5dv\_ts\_to\_ns(3)

Convert device timestamp from HCA core clock units to the corresponding nanosecond counts

## NAME

mlx5dv\_ts\_to\_ns - Convert device timestamp from HCA core clock units to the corresponding nanosecond counts

## SYNOPSIS

```
#include <infiniband/mlx5dv.h>

uint64_t mlx5dv_ts_to_ns(struct mlx5dv_clock_info *clock_info,
			      uint64_t device_timestamp);
```

## DESCRIPTION

**[mlx5dv\_ts\_to\_ns(3)](/mlx5dv_ts_to_ns/3.md)** Converts a host byte order *device\_timestamp* from HCA core clock units into the corresponding nanosecond wallclock time.

**struct mlx5dv\_clock\_info** can be retrieved using **[mlx5dv\_get\_clock\_info(3)](/mlx5dv_get_clock_info/3.md)**.

The greater the difference between the device reporting a timestamp and the last mlx5dv\_clock\_info update, the greater the inaccuracy of the clock time conversion.

## RETURN VALUE

Timestamp in nanoseconds

## SEE ALSO

[**mlx5dv**(7)](/mlx5dv/7.md), [**mlx5dv\_get\_clock\_info**(3)](/mlx5dv_get_clock_info/3.md), [**mlx5dv\_query\_device**(3)](/mlx5dv_query_device/3.md)

## AUTHORS

- Feras Daoud \<ferasda@mellanox.com\>
