#define _POSIX_C_SOURCE 199309L #include #include #include "common.h" double monotonic_seconds() { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); return ts.tv_sec + ts.tv_nsec * 1e-9; } /** * @brief Output the seconds elapsed while execution. * * @param seconds Seconds spent on execution, excluding IO. */ void print_time(double const seconds) { printf("Execution time: %0.04fs\n", seconds); }