+-- For _SC_CLK_TCK
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+-- For struct rusage
+#if !defined(mingw32_HOST_OS) && !defined(irix_HOST_OS)
+# if HAVE_SYS_RESOURCE_H
+# include <sys/resource.h>
+# endif
+#endif
+
+-- For FILETIME etc. on Windows
+#if HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+-- for CLK_TCK
+#if HAVE_TIME_H
+#include <time.h>
+#endif
+
+-- for struct tms
+#if HAVE_SYS_TIMES_H
+#include <sys/times.h>
+#endif
+
+#endif
+
+#if !defined(mingw32_HOST_OS) && !defined(cygwin32_HOST_OS)
+realToInteger :: Real a => a -> Integer
+realToInteger ct = round (realToFrac ct :: Double)
+ -- CTime, CClock, CUShort etc are in Real but not Fractional,
+ -- so we must convert to Double before we can round it