minix/lib/libc/ansi/difftime.c

18 lines
320 B
C
Raw Normal View History

2005-04-21 16:53:53 +02:00
/*
* difftime - compute the difference between two calendar times
*/
/* $Header$ */
#include <time.h>
double
difftime(time_t time1, time_t time0)
{
/* be careful: time_t may be unsigned */
if ((time_t)-1 > 0 && time0 > time1) {
return - (double) (time0 - time1);
} else {
return (double)(time1 - time0);
}
}