강현태

Add timer.c for measuring labtime.

File mode changed
#include <stdio.h>
File mode changed
File mode changed
#include <timer.h>
long tic(void){
struct timespec time_spec;
clock_gettime(CLOCK_THREAD_CPUTIME_ID,&time_spec);
return time_spec.tv_nsec;
}
long toc(long prev){
struct timespec time_spec;
int now;
now = clock_gettime(CLOCK_THREAD_CPUTIME_ID,&time_spec);
return time_speck.tv_nsec - prev;
}