]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/windows/time/time.factor
windows.time: faster windows-time>timestamp.
[factor.git] / basis / windows / time / time.factor
index 913e613312ebd369adf405b4ffa911ca89d69e6a..f0e31824499b49c3f6dea7e8927b2da52b29821f 100644 (file)
@@ -14,7 +14,7 @@ IN: windows.time
     [ dwLowDateTime>> ] [ dwHighDateTime>> ] bi >64bit ;
 
 : windows-time>timestamp ( n -- timestamp )
-    10000000 /i seconds windows-1601 swap time+ ;
+    [ windows-1601 ] dip 10,000,000 /i +second ;
 
 : windows-time ( -- n )
     FILETIME <struct> [ GetSystemTimeAsFileTime ] keep
@@ -22,7 +22,7 @@ IN: windows.time
 
 : timestamp>windows-time ( timestamp -- n )
     #! 64bit number representing # of nanoseconds since Jan 1, 1601 (UTC)
-    >gmt windows-1601 (time-) 10000000 * >integer ;
+    >gmt windows-1601 (time-) 10,000,000 * >integer ;
 
 : windows-time>FILETIME ( n -- FILETIME )
     [ FILETIME <struct> ] dip