diff --git a/include/time.h b/include/time.h
index 649e4f9f394a1ad505b1a7809bf4589ce42dcc57..f52435701374aa8700a2a12cda2dac637058b3a4 100644
--- a/include/time.h
+++ b/include/time.h
@@ -41,6 +41,7 @@
  ********************************************************************************/
 
 #include <nuttx/config.h>
+#include <nuttx/compiler.h>
 
 #include <sys/types.h>
 #include <stdint.h>
@@ -103,6 +104,7 @@
 /********************************************************************************
  * Public Types
  ********************************************************************************/
+
 /* Scalar types */
 
 typedef uint32_t  time_t;         /* Holds time in seconds */
@@ -214,8 +216,10 @@ FAR char *ctime_r(FAR const time_t *timep, FAR char *buf);
 
 time_t time(FAR time_t *timep);
 
-#if defined(CONFIG_LIBC_DIFFTIME)
+#ifdef CONFIG_HAVE_DOUBLE
 double difftime(time_t time1, time_t time0);
+#else
+float difftime(time_t time1, time_t time0);
 #endif
 
 int timer_create(clockid_t clockid, FAR struct sigevent *evp,
diff --git a/libc/time/Make.defs b/libc/time/Make.defs
index 0aeda13eefe01c3aaee2ad6b19ef754801b5e7e2..68e62436871cc2106c9b65a1f312e3f9e55c0a65 100644
--- a/libc/time/Make.defs
+++ b/libc/time/Make.defs
@@ -37,6 +37,7 @@
 
 CSRCS += lib_strftime.c lib_calendar2utc.c lib_daysbeforemonth.c
 CSRCS += lib_gettimeofday.c lib_isleapyear.c lib_settimeofday.c lib_time.c
+CSRCS += lib_difftime.c
 
 ifdef CONFIG_LIBC_LOCALTIME
 CSRCS += lib_localtime.c lib_asctime.c lib_asctimer.c lib_ctime.c
@@ -49,10 +50,6 @@ CSRCS += lib_ctimer.c
 endif
 endif
 
-ifdef CONFIG_LIBC_DIFFTIME
-CSRCS += lib_difftime.c
-endif
-
 # Add the time directory to the build
 
 DEPPATH += --dep-path time
diff --git a/libc/time/lib_difftime.c b/libc/time/lib_difftime.c
index 3487d118cd53d6cb0afa47dd4e19bbedb0471ca4..ee9a62ebb206fcf28962aaaf42afc68b25fe81b2 100644
--- a/libc/time/lib_difftime.c
+++ b/libc/time/lib_difftime.c
@@ -40,10 +40,9 @@
 #include <nuttx/config.h>
 #include <nuttx/compiler.h>
 
+#include <stdint.h>
 #include <time.h>
 
-#ifdef CONFIG_HAVE_DOUBLE
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -53,13 +52,35 @@
  *
  * Description:
  *   The difftime() function returns the number of seconds elapsed
- *   between time time1 and time time0, represented as a double.
+ *   between time time1 and time time0, represented as a double or a float.
+ *   Float is used if the platform does not support double. However, when
+ *   using a float, some precision may be lost for big differences.
  *
  ****************************************************************************/
 
+#ifdef CONFIG_HAVE_DOUBLE
 double difftime(time_t time1, time_t time0)
 {
   return (double)time1 - (double)time0;
 }
+#else
+float difftime(time_t time1, time_t time0)
+{
+  if (time1 >= time2)
+    {
+      /* Result will be positive (even though bit 31 may be set on very large
+       * differences!)
+       */
+
+      return (float)((uint32_t)(time1 - time0))
+    }
+  else
+    {
+      /* Result will be negative.  REVISIT: Am I missing any case where bit 31
+       * might not be set?
+       */
 
-#endif /* CONFIG_HAVE_DOUBLE */
+      return (float)((int32_t)(time1 - time0))
+    }
+}
+#endif