From 4d787db5bb05884577a5ba7acb05cd22b99ec641 Mon Sep 17 00:00:00 2001 From: ligd Date: Mon, 14 Sep 2020 18:35:34 +0800 Subject: [PATCH] Documentation: add gethrtime() API to "Clocks and Timers" Change-Id: I97a75a14427bcada8a408ced6e0203dc3345f162 Signed-off-by: ligd --- Documentation/reference/user/06_clocks_timers.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/reference/user/06_clocks_timers.rst b/Documentation/reference/user/06_clocks_timers.rst index cc96fe7fde..8785ef88fe 100644 --- a/Documentation/reference/user/06_clocks_timers.rst +++ b/Documentation/reference/user/06_clocks_timers.rst @@ -19,6 +19,7 @@ Clocks and Timers - :c:func:`timer_gettime` - :c:func:`timer_getoverrun` - :c:func:`gettimeofday` +- :c:func:`gethrtime` .. c:function:: int clock_settime(clockid_t clockid, const struct timespec *tp) @@ -358,3 +359,12 @@ Clocks and Timers :param tzp: A reference to the timezone -- *IGNORED*. :return: See :c:func:`clock_gettime`. + +.. c:function:: hrtime_t gethrtime(void); + + This implementation of ``gethrtime()`` is simply a + thin wrapper around :c:func:`clock_gettime`. It simply + calls ``clock_gettime()`` using the ``CLOCK_REALTIME`` or ``CLOCK_MONOTONIC``, + and converts the result to the required hrtime_t. + + :return: current system time in ns