I think this is an RTS option.<div><br></div><div><a href="http://www.haskell.org/ghc/docs/latest/html/users_guide/using-concurrent.html">http://www.haskell.org/ghc/docs/latest/html/users_guide/using-concurrent.html</a></div>
<div><br><div><br><br><div class="gmail_quote">On Tue, Apr 7, 2009 at 1:41 PM, Ulrik Rasmussen <span dir="ltr">&lt;<a href="mailto:haskell@utr.dk">haskell@utr.dk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello.<br>
<br>
I am writing a simple game in Haskell as an exercise, and in the<br>
rendering loop I want to cap the framerate to 60fps. I had planned to do<br>
this with GHC.Conc.threadDelay, but looking at it&#39;s documentation, I<br>
discovered that it can only delay the thread in time spans that are<br>
multiples of 20ms:<br>
<br>
<a href="http://www.haskell.org/ghc/docs/6.4/html/libraries/base/Control.Concurrent.html" target="_blank">http://www.haskell.org/ghc/docs/6.4/html/libraries/base/Control.Concurrent.html</a><br>
<br>
I need a much finer granularity than that, so I wondered if it is<br>
possible to either get a higher resolution for threadDelay, or if there<br>
is an alternative to threadDelay?<br>
<br>
I noticed that the SDL library includes the function &quot;delay&quot;, which<br>
indeed works with a resolution down to one millisecond. However, since<br>
I&#39;m using HOpenGL and GLUT, I think it would be a little overkill to<br>
depend on SDL just for this :).<br>
<br>
<br>
Thanks,<br>
<font color="#888888"><br>
Ulrik Rasmussen<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</font></blockquote></div><br></div></div>