MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / pthread_getcpuclockid

Function pthread_getcpuclockid

components/libc/posix/pthreads/pthread.c:707–717  ·  view source on GitHub ↗

* @brief Retrieves the clock ID for the specified thread. * * The `pthread_getcpuclockid` function retrieves the clock ID associated with the CPU time used * by the specified thread. * * @param[in] thread * The thread whose CPU clock ID is to be retrieved. If the thread is the calling thread, * the current thread's ID is used. * * @param[out] clock_id * A pointer to a `clockid_t` v

Source from the content-addressed store, hash-verified

705 * @see clock_gettime, pthread_create, pthread_self
706 */
707int pthread_getcpuclockid(pthread_t thread, clockid_t *clock_id)
708{
709 if(_pthread_get_data(thread) == NULL)
710 {
711 return EINVAL;
712 }
713
714 *clock_id = (clockid_t)rt_tick_get();
715
716 return 0;
717}
718RTM_EXPORT(pthread_getcpuclockid);
719
720/**

Callers

nothing calls this directly

Calls 2

_pthread_get_dataFunction · 0.85
rt_tick_getFunction · 0.85

Tested by

no test coverage detected