---
name: "clock_gethrtime"
section: "3"
platform: "linux"
package: "rtlinux"
version: "2.0rel-1"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/clock_gethrtime"
---

# clock\_gethrtime(3)

get high resolution time using the specified clock

## NAME

clock\_gethrtime - get high resolution time using the specified clock

## SYNOPSIS

**#include \<rtl\_time.h\>**

**hrtime\_t clock\_gethrtime(clockid\_t clock);**

## DESCRIPTION

This function is a non-portable Real-Time Linux extension. **clock\_gethrtime** returns the **clock** reading in nanoseconds. This is a convenience function for **[clock\_gettime(3)](/clock_gettime/3.md)**

**hrtime\_t** is a 64-bit signed integer.

## NOTES

The following clocks are supported by this release of Real-Time Linux:

- **CLOCK\_REALTIME**

  The standard POSIX clock.

- **CLOCK\_8254**

  The clock that is used on non-SMP x86 systems.

- **CLOCK\_APIC**

  The local APIC clock on SMP x86 systems.

## AUTHOR

Michael Barabanov \<baraban@fsmlabs.com\>

## SEE ALSO

[**rtl\_getschedclock**(3)](/rtl_getschedclock/3.md), [**rtl\_setclockmode**(3)](/rtl_setclockmode/3.md),

[**clock\_gettime**(3)](/clock_gettime/3.md), [**clock\_gethrtime**(3)](/clock_gethrtime/3.md)
