Initial commit of files related to NED architecture.
[ned1] / misc / clocktest.c
/*
* © 2018 Aaron Taylor <ataylor at subgeniuskitty dot com>
* See LICENSE.txt file for copyright and license details.
*/
#include <stdio.h>
#include <time.h>
int
main(int argc, char ** argv)
{
struct timespec ts = {0,0};
int retval;
retval = clock_getres(CLOCK_MONOTONIC, &ts);
if (!retval) {
printf("Clock resolution: %ld s -- %ld ns\n", ts.tv_sec, ts.tv_nsec);
}
retval = clock_gettime(CLOCK_MONOTONIC, &ts);
if (!retval) {
printf("Current clock: %ld s -- %ld ns\n", ts.tv_sec, ts.tv_nsec);
}
}