Function rc_nanos_thread_time#

Function Documentation#

uint64_t rc_nanos_thread_time(void)#

Returns the number of nanoseconds from when when the calling thread was started in CPU time.

This uses CLOCK_THREAD_CPUTIME_ID. This time only increments when the processor is working on the calling thread and not when the thread is sleeping. This is usually for timing how long blocks of user-code take to execute. This function itself takes about 2100ns to complete on a beaglebone at 1ghz under ideal circumstances.

Returns:

nanoseconds of CPU time since thread started