Documentation: add gethrtime() API to "Clocks and Timers"

Change-Id: I97a75a14427bcada8a408ced6e0203dc3345f162
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2020-09-14 18:35:34 +08:00 committed by Matias N
parent c38c821fc2
commit 4d787db5bb
1 changed files with 10 additions and 0 deletions

View File

@ -19,6 +19,7 @@ Clocks and Timers
- :c:func:`timer_gettime` - :c:func:`timer_gettime`
- :c:func:`timer_getoverrun` - :c:func:`timer_getoverrun`
- :c:func:`gettimeofday` - :c:func:`gettimeofday`
- :c:func:`gethrtime`
.. c:function:: int clock_settime(clockid_t clockid, const struct timespec *tp) .. 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*. :param tzp: A reference to the timezone -- *IGNORED*.
:return: See :c:func:`clock_gettime`. :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