Will having many timers affect my game performance?
- by iQue
I'm making a game for android, and earlier today I was trying to add some cool stuff to my game. The problem is this thing needs like 5 timers. I build my timers like this:
timer += deltaTime;
if(timer >= 2.0f){
doStuff;
timer -= 2.0f;
} // this timers gets stuff done every 2 secs
Will having to many timers like this, getting checked every frame, screw up my games performance? The effect I wanted to add was a crosshair every 2 sec, then remove it after 2 sec and do a timed animation. So an array of crosshairs dependent on a bunch of timers to be exact. This caused my game to shut down when used, so thats why Im wondering if using that many timers causes my game to flip out.