Re-instate timediff(), needed in winmain.c

This commit is contained in:
caand 2020-08-23 15:59:10 +02:00
parent fc445c2b0a
commit 130d96ff2f
2 changed files with 25 additions and 0 deletions

View File

@ -40,6 +40,25 @@ datestring(void)
#endif #endif
} }
/* return time interval in seconds and milliseconds */
#ifdef HAVE_FTIME
void timediff(struct timeb* now, struct timeb* begin, int* sec, int* msec)
{
*msec = (int)now->millitm - (int)begin->millitm;
*sec = (int)now->time - (int)begin->time;
if (*msec < 0) {
*msec += 1000;
(*sec)--;
}
return;
}
#endif
/* Initialize time */ /* Initialize time */

View File

@ -10,4 +10,10 @@ char * datestring(void);
double seconds(void); double seconds(void);
void timebegin(void); void timebegin(void);
// Needed for WIN32
#ifdef HAVE_FTIME
void timediff(struct timeb*, struct timeb*, int*, int*);
#endif
#endif #endif