---
name: "timespec_getres"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/timespec_getres"
---

# timespec\_getres(3)

get clock resolution

## NAME

**timespec\_getres** – get clock resolution

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<time.h\>**

*int*\

**timespec\_getres**(*struct timespec \*ts*, *int base*);

## DESCRIPTION

If *ts* is non-null and *base* refers to a supported time base as described in [timespec\_get(3)](/timespec_get/3.md), the **timespec\_getres** function fills in the structure pointed to by *ts* to reflect the resolution of that time base.

## RETURN VALUES

The **timespec\_getres** function returns the value of *base* if successful and zero otherwise.

## SEE ALSO

[clock\_getres(2)](/clock_getres/2.md), [timespec\_get(3)](/timespec_get/3.md)

## STANDARDS

The **timespec\_getres** function conforms to ISO/IEC 9899:2024 (“ISO C23”).

## HISTORY

This interface first appeared in FreeBSD 14.

## AUTHORS

The **timespec\_getres** function and this manual page were written by Dag-Erling Smørgrav ⟨*des@FreeBSD.org*⟩.
