Hello,
I work on a game with rider (https://www.jetbrains.com/rider/) with an almost empty monogame project. In fact i only have one sprite wich is moving across the screen but the movements is not smooth at all. I profile my game and i saw that 70% of the process time is in the Thread.Sleep() method of monogame.
So why monogame prefer to sleep instead of run my game more smoothly ?
MonoGame runs at a fixed time step of 60 fps by default. It sleeps if it has time left over until the next frame. Set Game.IsFixedTimeStep and GraphicsDeviceManager.SynchronizeWithVerticalRetrace to false to unlock frame rate.
You probably had FixedTimeStep=true and VSync=false.
In than case MG MG uses Sleep() which is indeed unstable. Sometimes it sleeps more than what’s needed and you skip a frame.
With FixedTimeStep=true and VSync=true the frames are mostly synced by the GPU.
With FixedTimeStep=false and VSync=false you are drawing as many frames as possible without sleeping. you still seeing what your monitor can draw but it’s useful for benchmarking.
Ok nice ! I undestand better now and those freeze dont come from Monogame but from my old monitor
So with a more recent display it worked very well and smoothly
Any way i did not lose my time it was instructive