add daxpy, dgemv
[blas_decision:mainline.git] / timer.c
1 #include <stdio.h>
2 #include <sys/time.h>
3
4 static struct timeval tv_start, tv_stop;
5 void timer_start()
6 {
7         gettimeofday(&tv_start, NULL);
8 }
9
10 double timer_stop()
11 {
12         double diff;
13         gettimeofday(&tv_stop, NULL);
14         
15         diff = (tv_stop.tv_sec - tv_start.tv_sec) +
16                    (tv_stop.tv_usec - tv_start.tv_usec) * 1e-6;
17         return diff;
18 }