lancelot2112

Results 7 comments of lancelot2112

might be related to the "fingerprint" security patch firefox added. They limit the resolution of their timer to a certain number of milliseconds. I've seen some places online where it...

![sim_time](https://user-images.githubusercontent.com/2574163/144719053-8b37abef-7154-494c-83c7-c381584d6c12.png) Created some helper classes for timing. not sure on best way to show stats other than console.log. didn't want to hog throughput on that so updates every second. Max...

I'll have to look a little closer at the infinity, might just be that two calls to the function happened so close together that the timer resolution wasn't big enough...

Were you running firefox perchance? Seems firefox does some rounding to the nearest millisecond, will protect for this. https://stackoverflow.com/questions/6875625/does-javascript-provide-a-high-resolution-timer

Changes to Timer class: changed "tick" to "time_since_last_update" and "update" to "update_state". Changes to Stats class: changed "take" to "add_value"

I think it's in how it's scheduled. setInterval with a 10ms frame interval will work like the following (100fps) code-runtime: [ 5ms ]-----[ 5ms ]-----[ 12ms ------- ][ 5ms ]...

if you move the "setTimeout" code to the beginning of the updateSimulation() call it will replicate the "setInterval" behavior. ```javascript updateSimulation() { setTimeout(func,1000/fps); //starts counting from start of exec instead...