2007-01-16 Tor Lillqvist <tml@novell.com>
* glib/gthread.c (gettime): GetSystemTimeAsFileTime() returns 100s
- of nanoseconds, so multiply by 100 to get nanoseconds which is
- what we want.
+ of nanoseconds since 1601, so offset to Unix epoch (1970) and
+ multiply by 100 to get nanoseconds which is what we want.
2007-01-15 Tor Lillqvist <tml@novell.com>
#ifdef G_OS_WIN32
guint64 v;
+ /* Returns 100s of nanoseconds since start of 1601 */
GetSystemTimeAsFileTime ((FILETIME *)&v);
+
+ /* Offset to Unix epoch */
+ v -= G_GINT64_CONSTANT (116444736000000000);
+ /* Convert to nanoseconds */
v *= 100;
return v;
2007-01-16 Tor Lillqvist <tml@novell.com>
* gthread-win32.c (g_gettime_win32_impl):
- GetSystemTimeAsFileTime() returns 100s of nanoseconds, so multiply
- by 100 to get nanoseconds which is what we want.
+ GetSystemTimeAsFileTime() returns 100s of nanoseconds since 1601,
+ so offset to Unix epoch (1970) and multiply by 100 to get
+ nanoseconds which is what we want.
2006-12-28 Tor Lillqvist <tml@novell.com>
{
guint64 v;
+ /* Returns 100s of nanoseconds since start of 1601 */
GetSystemTimeAsFileTime ((FILETIME *)&v);
+
+ /* Offset to Unix epoch */
+ v -= G_GINT64_CONSTANT (116444736000000000);
+ /* Convert to nanoseconds */
v *= 100;
return v;