DSDP
dsdptime.c
Go to the documentation of this file.
1 /* DSDPTime could return 0 and still work */
6 /*
7 #define DSDP_TIME
8 */
9 
10 #include "dsdpsys.h"
11 
12 #ifdef DSDP_MS_TIME
13 #include <ctype.h>
14 #include <time.h>
15 void DSDPTime(double * ttime) { /* MICROSOFT COMPILER */
16  clock_t t=clock();
17  double tscale=0.001;
18  (*ttime)=((double)t) * tscale;
19 }
20 #else
21 #ifdef DSDP_TIME
22 #include <sys/time.h>
23 void DSDPTime(double * ttime) { /* USED IN LINUX */
24  static struct timeval _tp;
25  *ttime=0;
26  gettimeofday(&_tp,(struct timezone *)0);
27  (*ttime)=((double)_tp.tv_sec)+(1.0e-6)*(_tp.tv_usec);
28 }
29 #else
30 void DSDPTime(double * ttime) { *ttime=0; return; } /* NO TIME */
31 #endif
32 #endif
33 /* for Microsoft */
34 /*
35 */
Error handling, printing, and profiling.