librfn
An ad-hoc utility library
Functions
Time management

Easy to use, high resolution timer functions. More...

Functions

void time_init (void)
 
uint32_t time_now (void)
 
uint64_t time64_now (void)
 

Detailed Description

Easy to use, high resolution timer functions.

Function Documentation

uint64_t time64_now ( void  )

Get the current wall time in microseconds.

On POSIX systems this is merely a wrapper around clock_gettime() but is often less cumbersome to work with.

Definition at line 48 of file time_libopencm3.c.

void time_init ( void  )

Initialize the time sub-system.

Definition at line 26 of file time_libopencm3.c.

uint32_t time_now ( void  )

Get the current wall time in microseconds and modulo 2^32.

The output of this function will wrap after slightly more than one hour. There this function is only particularly useful for measuring small intervals on small micro-controller systems where 64-bit arithmetic might be regarded as expensive (either in cycles or memory use).

Definition at line 42 of file time_libopencm3.c.