ack/lang/cem/libcc.ansi/time/difftime.c
2018-06-21 22:33:47 +02:00

21 lines
317 B
C

/*
* difftime - compute the difference between two calendar times
*/
/* $Id$ */
#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);
}
}