This commit is contained in:
cvs
2003-05-02 06:19:00 +00:00
parent 7669a9b3fb
commit ebcffe3c3e

View File

@ -1,11 +1,9 @@
#include <assert.h> #include <assert.h>
#include <sys/time.h> #include <sys/time.h>
#include <time.h> #include <time.h>
/* #if __VMS
#include <sys/types.h>
#include <sys/timeb.h> #include <sys/timeb.h>
int ftime (struct timeb *__timeptr); #endif
*/
#include "myc_fortran.h" #include "myc_fortran.h"
#include "myc_time.h" #include "myc_time.h"
@ -38,19 +36,21 @@ int mycNow(void) {
} }
int mycMsecSince(int since) { int mycMsecSince(int since) {
/* #if __VMS
struct timeb now; struct timeb now;
*/ #else
struct timeval now; struct timeval now;
#endif
int msec; int msec;
if (my_base == 0) initBase(); if (my_base == 0) initBase();
/* #if __VMS
ftime(&now); ftime(&now);
msec = (now.time - my_base) % (24*3600) * 1000 + now.millitm - since; msec = (now.time - my_base) % (24*3600) * 1000 + now.millitm - since;
*/ #else
gettimeofday(&now, NULL); gettimeofday(&now, NULL);
msec = (now.tv_sec - my_base) % (24*3600) * 1000 + now.tv_usec/1000 - since; msec = (now.tv_sec - my_base) % (24*3600) * 1000 + now.tv_usec/1000 - since;
#endif
if (msec < 0) msec+=24*3600000; if (msec < 0) msec+=24*3600000;
return msec; return msec;
} }