+ 1
Why is the fps & interval NaN?[SOLVED]
Everything seems fine but the fps is NaN and so is the interval. Why is this happening? https://code.sololearn.com/WwweLFkgnbOG/?ref=app
2 Antworten
+ 6
Change line 31:
interval = (Date.now()-t)/1000;
NaN usually arises when some math operation fails. In this case, you passer the Date.now method into a subtraction operation with t which does not work.
+ 1
👑 Prometheus 🇸🇬 thank you, I was missing () after the Date.now method. Now it works fine.