]> pd.if.org Git - pdclib/commitdiff
difftime.c
authorMartin Baute <solar@rootdirectory.de>
Mon, 4 Apr 2016 05:17:14 +0000 (07:17 +0200)
committerMartin Baute <solar@rootdirectory.de>
Mon, 4 Apr 2016 05:17:14 +0000 (07:17 +0200)
functions/time/difftime.c
platform/example/internals/_PDCLIB_config.h

index d2dcfacbce7d79916ce1211d7ce7df31fdfc6f18..fa6eb9c7f741cfeb0fd12fa1a5b520cc6c4a828d 100644 (file)
@@ -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
index 4dd5e3a125d4b07df9af0876f50549ef290116d6..41fe9e0a394bcb757004000824fb636acd0ffaf1 100755 (executable)
@@ -174,6 +174,9 @@ struct _PDCLIB_imaxdiv_t
 /* Time types                                                                 */
 /* -------------------------------------------------------------------------- */
 
+/* See <time.h> 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