timespec_getres(3)

timespec_getres3

Get clock resolution

Usage

#include <time.h>

int

timespec_getres(struct timespec *ts, int base);

Library

Standard C Library (libc, -lc)

Overview

If ts is non-null and base refers to a supported time base as described in timespec_get(3), 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.

Releases

9 releases since FreeBSD 14.0-RELEASE; the text changed 1 time.

  1. 14.0–15.0
  2. 15.1–16.0

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 ⟨[email protected]⟩.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.