Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualunbird

Posted 04 May 2013 - 12:27 PM

Well I said you shouldn't use Thread.Sleep wink.png. Get accurate timing first. You can e.g. use the System.Diagnostics.Stopwatch: Start it at program start and use the Elapsed property.

 

Edit: As Servant pointed out. You use the delta to "feed your simulation", not the other way round.

 

Now: Even the Stopwatch normally has a granularity which might pose a problem (15 ms if memory serves). Check if Stopwatch.IsHighresolution is enabled, it usually is. You will have to do the conversion yourself with (double)Stopwatch.ElapsedTicks / Stopwatch.Frequency.


#2unbird

Posted 04 May 2013 - 12:27 PM

Well I said you shouldn't use Thread.Sleep wink.png. Get accurate timing first. You can e.g. use the System.Diagnostics.Stopwatch: Start it at program start and use the Elapsed property.

 

Edit: As Servant pointed out. You use the delta "feed your simulation", not the other way round.

 

Now: Even the Stopwatch normally has a granularity which might pose a problem (15 ms if memory serves). Check if Stopwatch.IsHighresolution is enabled, it usually is. You will have to do the conversion yourself with (double)Stopwatch.ElapsedTicks / Stopwatch.Frequency.


#1unbird

Posted 04 May 2013 - 12:22 PM

Well I said you shouldn't use Thread.Sleep :wink:. Get accurate timing first. You can e.g. use the System.Diagnostics.Stopwatch: Start it at program start and use the Elapsed property.

 

Now: Even the Stopwatch normally has a granularity which might pose a problem (15 ms if memory serves). Check if Stopwatch.IsHighresolution is enabled, it usually is. You will have to do the conversion yourself with (double)Stopwatch.ElapsedTicks / Stopwatch.Frequency.


PARTNERS