add timediff for reverted sharedspice.c
This commit is contained in:
parent
6c04ef10d7
commit
2989bbfcc0
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue