<p></p>
<p>Hi Christoph,</p>
<p>first it's not true that Time is broken on Windows:</p>
<p>Smalltalk os platformName 'Win32'<br>
Smalltalk getSystemAttribute: 1007 'CoInterpreter VMMaker.oscog-eem.2850 uuid: 4d7fc8a4-2c7d-4bad-8aeb-5f8c5766e12a Oct 21 2020'<br>
DateAndTime now 2020-10-22T23:06:29.983933-07:00<br>
Time utcMicrosecondClock 3780886299961528</p>
<p>It is true that unless you have 8.1 or later and have GetSystemTimePreciseAsFileTime in kernel32 then Time will not work.  Here:</p>
<pre><code>$ git diff 712cfe6c3e29667b56e668d7641daced18efb666 platforms/win32/vm/sqWin32Heartbeat.c | more
diff --git a/platforms/win32/vm/sqWin32Heartbeat.c b/platforms/win32/vm/sqWin32H
eartbeat.c
old mode 100644
new mode 100755
index 85d27674a..70c430889
--- a/platforms/win32/vm/sqWin32Heartbeat.c
+++ b/platforms/win32/vm/sqWin32Heartbeat.c
@@ -14,6 +14,7 @@
 #include <mmsystem.h>

 #include "sq.h"
+#undef EXPORT
 #include "sqAssert.h"
 #include "sqMemoryFence.h"

@@ -76,19 +77,41 @@ sqLong ioHighResClock(void) {
   return value;
 }

+#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
+
+/* Compute the current VM time basis, the number of microseconds from 1901.
+ *
+ * As of Windows 8 there is a FILETIME wall clock interface which is high
+ * precision and so does not have to be combined with the millisecond clock.
+ */
+# define currentUTCMicroseconds(a,b,c) currentUTCMicrosecondsImplementation()
+static inline unsigned __int64
+currentUTCMicrosecondsImplementation(void)
+{
+       union { // got to love little-endian architectures...
+               FILETIME         utcNowFiletime;
+               unsigned __int64 utcNow;
+       } un;
+
+       // cannot fail...
+       GetSystemTimePreciseAsFileTime(&un.utcNowFiletime);
+       return un.utcNow / TocksPerMicrosecond - MicrosecondsFrom1601To1901;
+}
+#else // _WIN32_WINNT >= _WIN32_WINNT_WIN8
+
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/531#issuecomment-714939175">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AIJPEWYZ2RSFYPCZJNBAKBTSMENRHANCNFSM4S3RGTGQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AIJPEWZMNLR5MGO2XTIA3JDSMENRHA5CNFSM4S3RGTG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFKORWJY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/531#issuecomment-714939175",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/531#issuecomment-714939175",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>