1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/* Public domain. */ #ifndef _LINUX_SCHED_CLOCK_H #define _LINUX_SCHED_CLOCK_H #include <sys/types.h> #include <sys/time.h> #include <linux/smp.h> static inline uint64_t local_clock(void) { struct timespec ts; nanouptime(&ts); return (ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec; } #endif