From: Martin Baute Date: Mon, 4 Apr 2016 05:17:14 +0000 (+0200) Subject: difftime.c X-Git-Url: https://pd.if.org/git/?p=pdclib;a=commitdiff_plain;h=b0ae5d16c993045fd9ec5e7866962164bf9934fd difftime.c --- diff --git a/functions/time/difftime.c b/functions/time/difftime.c index d2dcfac..fa6eb9c 100644 --- a/functions/time/difftime.c +++ b/functions/time/difftime.c @@ -10,7 +10,7 @@ double difftime( time_t time1, time_t time0 ) { - return 0.0; + return ( time1 > time0 ) ? (double)( time1 - time0 ) : -(double)( time0 - time1 ); } #endif diff --git a/platform/example/internals/_PDCLIB_config.h b/platform/example/internals/_PDCLIB_config.h index 4dd5e3a..41fe9e0 100755 --- a/platform/example/internals/_PDCLIB_config.h +++ b/platform/example/internals/_PDCLIB_config.h @@ -174,6 +174,9 @@ struct _PDCLIB_imaxdiv_t /* Time types */ /* -------------------------------------------------------------------------- */ +/* See for a couple of comments on these types and their semantics. */ + +/* If you change this type to something exotic, check time/difftime.c */ #define _PDCLIB_time long #define _PDCLIB_clock long