[Git][ghc/ghc][master] Small change to the windows ticker.

Marge Bot gitlab at gitlab.haskell.org
Tue Apr 14 11:56:04 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
074c1ccd by Andreas Klebinger at 2020-04-14T07:55:55-04:00
Small change to the windows ticker.

We already have a function to go from time to ms so use it.
Also expand on the state of timer resolution.

- - - - -


1 changed file:

- rts/win32/Ticker.c


Changes:

=====================================
rts/win32/Ticker.c
=====================================
@@ -30,6 +30,12 @@ static VOID CALLBACK tick_callback(
 // be very useful for profiling with a max usable resolution of
 // 15ms. Unfortunately we don't have anything better.
 
+// Update as of 2020-04-02:
+// It seems we can get somewhat reliable resolution even for intervals
+// at 1ms which had an average error of <5%.
+// This seems to be the case starting at some point during the
+// Windows 7 lifetime and any newer versions of windows.
+
 void
 initTicker (Time interval, TickProc handle_tick)
 {
@@ -53,7 +59,7 @@ startTicker(void)
                               tick_callback,
                               0,
                               0,
-                              TimeToUS(tick_interval) / 1000, // ms
+                              TimeToMS(tick_interval), // ms
                               WT_EXECUTEINTIMERTHREAD);
     if (r == 0) {
         sysErrorBelch("CreateTimerQueueTimer");



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/074c1ccd3f8c3fcab117e336316173e8e869230a

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/074c1ccd3f8c3fcab117e336316173e8e869230a
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200414/933bad4b/attachment.html>


More information about the ghc-commits mailing list