DSDP
|
00001 /* DSDPTime could return 0 and still work */ 00006 /* 00007 #define DSDP_TIME 00008 */ 00009 00010 #include "dsdpsys.h" 00011 00012 #ifdef DSDP_MS_TIME 00013 #include <ctype.h> 00014 #include <time.h> 00015 void DSDPTime(double * ttime) { /* MICROSOFT COMPILER */ 00016 clock_t t=clock(); 00017 double tscale=0.001; 00018 (*ttime)=((double)t) * tscale; 00019 } 00020 #else 00021 #ifdef DSDP_TIME 00022 #include <sys/time.h> 00023 void DSDPTime(double * ttime) { /* USED IN LINUX */ 00024 static struct timeval _tp; 00025 *ttime=0; 00026 gettimeofday(&_tp,(struct timezone *)0); 00027 (*ttime)=((double)_tp.tv_sec)+(1.0e-6)*(_tp.tv_usec); 00028 } 00029 #else 00030 void DSDPTime(double * ttime) { *ttime=0; return; } /* NO TIME */ 00031 #endif 00032 #endif 00033 /* for Microsoft */ 00034 /* 00035 */