#include #include #include #include #include #include #include #include "measure.h" #include "returncode.h" #include "time_conversion.h" void measure_start(struct timespec* m) { int status; status=clock_gettime(CLOCK_REALTIME, m); if(status<0) returncode("clock_gettime",status); } void measure_end(struct timespec m, char* msg) { int status; double f=1000000000; struct timespec measure_ts_end; struct timespec result; // long result_nsec; status=clock_gettime(CLOCK_REALTIME, &measure_ts_end); if(status<0) returncode("clock_gettime",status); result=ts_substract(measure_ts_end, m); f = ((double)(result.tv_sec))*f; f = f + (double)result.tv_nsec; printf("measure %s:%lf \n", msg, f); }