1👍
✅
Do you mean something like this?
startTimer () {
let interval = 90
if (this.crashValue > 2.15) {
interval = 80
}
if (this.crashValue > 3.15) {
interval = 70
}
setTimeout(this.crashFunction, interval);
}
In your code you’re creating two timers that are running at the same time. Every time one of those timers fires it’ll create another two timers, leading to an exponential growth in the number of timers running.
If I’ve understood correctly then you just need a single timer and a bit of suitable logic to determine the current interval.
Source:stackexchange.com