[Haskell-cafe] threadDelay granularity
bugfact at gmail.com
Tue Apr 7 08:53:20 EDT 2009
I think this is an RTS option.
On Tue, Apr 7, 2009 at 1:41 PM, Ulrik Rasmussen <haskell at utr.dk> wrote:
> I am writing a simple game in Haskell as an exercise, and in the
> rendering loop I want to cap the framerate to 60fps. I had planned to do
> this with GHC.Conc.threadDelay, but looking at it's documentation, I
> discovered that it can only delay the thread in time spans that are
> multiples of 20ms:
> I need a much finer granularity than that, so I wondered if it is
> possible to either get a higher resolution for threadDelay, or if there
> is an alternative to threadDelay?
> I noticed that the SDL library includes the function "delay", which
> indeed works with a resolution down to one millisecond. However, since
> I'm using HOpenGL and GLUT, I think it would be a little overkill to
> depend on SDL just for this :).
> Ulrik Rasmussen
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe