add timediff for reverted sharedspice.c

This commit is contained in:
dwarning 2024-10-28 18:41:40 +01:00
parent 6c04ef10d7
commit 2989bbfcc0
2 changed files with 29 additions and 0 deletions

View File

@ -43,6 +43,27 @@ datestring(void)
#endif
}
/* return time interval in seconds and milliseconds */
#ifdef HAVE_FTIME
struct timeb timebegin;
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
/*
* How many seconds have elapsed in running time.
* This is the routine called in IFseconds

View File

@ -18,4 +18,12 @@ void perf_timer_start(PerfTimer *);
void perf_timer_stop(PerfTimer *);
void perf_timer_elapsed_sec_ms(const PerfTimer *, int *, int *);
#ifdef HAVE_FTIME
extern struct timeb timebegin;
void timediff(struct timeb *, struct timeb *, int *, int *);
#endif
#endif