2005-01-15 Matthias Clasen <mclasen@redhat.com>
* glib/gthread.c:
* gthread/gthread-posix.c: Correct the gettime calculations
once more. (#395203, Chris Wilson)
svn path=/trunk/; revision=5262
+2005-01-15 Matthias Clasen <mclasen@redhat.com>
+
+ * glib/gthread.c:
+ * gthread/gthread-posix.c: Correct the gettime calculations
+ once more. (#395203, Chris Wilson)
+
2007-01-15 Tor Lillqvist <tml@novell.com>
* glib/gmain.h (struct _GPollFD): Prepare for potential Win64
g_error ("The thread system is not yet initialized.");
}
+#define G_NSEC_PER_SEC 1000000000
+
static guint64
gettime (void)
{
gettimeofday (&tv, NULL);
- return (guint64) tv.tv_sec * 1000000000 + tv.tv_usec * 1000;
+ return (guint64) tv.tv_sec * G_NSEC_PER_SEC + tv.tv_usec * (G_NSEC_PER_SEC / G_USEC_PER_SEC);
#endif
}
static guint64
g_gettime_posix_impl (void)
{
-#define G_NSEC_PER_SEC 100000000000
#ifdef USE_CLOCK_GETTIME
struct timespec tv;
gettimeofday (&tv, NULL);
- return (guint64) tv.tv_sec * G_NSEC_PER_SEC + tv.tv_usec * 1000;
+ return (guint64) tv.tv_sec * G_NSEC_PER_SEC + tv.tv_usec * (G_NSEC_PER_SEC / G_USEC_PER_SEC);
#endif
}