#include #include "timer.h" u64 nn_get_timestamp(void) { struct timespec spec; clock_gettime(CLOCK_REALTIME, &spec); return 1e6 * spec.tv_sec + spec.tv_nsec * 1e-3; } f64 nn_get_tick(void) { struct timespec spec; clock_gettime(CLOCK_MONOTONIC, &spec); return spec.tv_sec + spec.tv_nsec * 1e-9; }