It works:
#include <unistd.h> #include <time.h> uint32_t getTick() { struct timespec ts; unsigned theTick = 0U; clock_gettime( CLOCK_REALTIME, &ts ); theTick = ts.tv_nsec / 1000000; theTick += ts.tv_sec * 1000; return theTick; }
yes, get_tick () is the foundation of my applications. It consists of one state machine for each "task", for example, it can perform multitasking without using threads, and Inter Process Communication can implement non-blocking delays.
penguinapricotman Jul 27 '14 at 12:48 2014-07-27 12:48
source share