20 #include <tensor/config.h>
22 #ifdef HAVE_GETTIMEOFDAY
25 #include <tensor/tools.h>
29 #if defined(HAVE_GETTIMEOFDAY)
31 struct timeval tic_start;
36 gettimeofday(&tic_start, NULL);
49 struct timeval tic_now;
50 gettimeofday(&tic_now, NULL);
51 double seconds = tic_now.tv_sec - tic_start.tv_sec;
52 double museconds = tic_now.tv_usec - tic_start.tv_usec;
53 return seconds + 1e-6 * museconds;
58 #if !defined(HAVE_GETTIMEOFDAY)
60 static clock_t tic_start;
78 return (clock()-tic_start)/((double)CLOCKS_PER_SEC);