[MLton-commit] r6840

Wesley Terpstra wesley at mlton.org
Sun Sep 7 09:37:42 PDT 2008


Here is a test program that can show the resolution of the gettimeofday and setitimer implementation:

val time = ref (Time.now ())
fun delta () = 
   let
      val now = Time.now ()
      val off = Time.- (now, !time)
      val () = print ("Delta: " ^ LargeInt.toString (Time.toMicroseconds off) ^ "us\n")
   in
      time := now
   end

val x = Time.fromMilliseconds 1
val () = MLton.Signal.setHandler (MLton.Itimer.signal MLton.Itimer.Real,
                                  MLton.Signal.Handler.simple delta)
val () = MLton.Itimer.set (MLton.Itimer.Real, { interval = x, value = x })

fun loop () = loop ()
val () = loop ()

----------------------------------------------------------------------

U   mlton/trunk/runtime/platform/mingw.c

----------------------------------------------------------------------

Modified: mlton/trunk/runtime/platform/mingw.c
===================================================================
--- mlton/trunk/runtime/platform/mingw.c	2008-09-07 16:34:17 UTC (rev 6839)
+++ mlton/trunk/runtime/platform/mingw.c	2008-09-07 16:37:41 UTC (rev 6840)
@@ -217,7 +217,7 @@
         /* Initialize the TimerQueue */
         if (MainThread == 0) {
                 /* This call improves the resolution of the scheduler from
-                 * 16ms to about 2ms in my testing. Sadly, it requires winmm.
+                 * 16ms to about 2ms in my testing. Sadly it requires winmm.
                  */
                 timeBeginPeriod(1);
 




More information about the MLton-commit mailing list