You could create a new thread which would be 'forever' executing your extensive computation and updating some IOVar accordingly. The drawing function would do nothing except reading that IOVar and displaying its contents. Since drawing is cheap, this can be done at any reasonable rate.
Daniel Díaz.Thanks in advance,I would be really thankful with any pointer here.In the other hand, I am using the animateIO function which ask me for an Int value to set up "the number of simulation steps to take for each second of real time". But I'm more interested in the animation waiting for the simulation step to end. Does it make sense?The rest of the program is small and simple. The drawing function (Model -> IO Picture -- it is pure though) is as quick as simple. However, the program get stuck after the first iteration.return newModelp <- slowOperation...step m = dostep :: Model -> IO ModelI have the step function:I will try to give some details.Hello cafe!I'm having some performance issues trying to use gloss to make animations where each "model" step is relatively time expensive. I'm using the IO.Simulate module because my step function needs to do an IO operation which takes around 1 second (it may vary).
...
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe