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

# gethrtime(3)

get high resolution time

## NAME

gethrtime - get high resolution time

## SYNOPSIS

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

**hrtime\_t gethrtime(void);**

## DESCRIPTION

This function is a non-portable Real-Time Linux extension. **gethrtime** returns the time in nanoseconds since the system bootup. This time is never reset or adjusted. **gethrtime** always gives monotonically increasing values. **hrtime\_t** is a 64-bit signed integer.

The **HRTIME\_INFINITY** symbol represents the maximum possible value that **gethrtime()** could possibly return. This value will be never reached during the execution of the system, and can be used to designate the infinitely distant moment in time.

## NOTES

The actual resolution of gethrtime is hardware-dependent. It is guaranteed to be better than 1 microsecond.

## AUTHOR

Michael Barabanov \<baraban@fsmlabs.com\>

## SEE ALSO

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