# setInterval stopped working without any reason at all

**URL:** <https://forum.kirupa.com/t/setinterval-stopped-working-without-any-reason-at-all/218781>\
**Category:** flash\
**Created:** [March 10, 2007, 11:01pm UTC](https://forum.kirupa.com/t/setinterval-stopped-working-without-any-reason-at-all/218781 "2007-03-10T23:01:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Binji](https://avatars.discourse-cdn.com/v4/letter/b/cdc98d/32.png) [@Binji](https://forum.kirupa.com/u/Binji)\
**Post date:** [March 10, 2007, 11:01pm UTC](https://forum.kirupa.com/t/setinterval-stopped-working-without-any-reason-at-all/218781/1 "2007-03-10T23:01:17Z")

</div>

Im really beginning to lose it… All i wanted to do is make a stopwatch with a couple more functions.  
At first everything worked. Later i changed some code (nothing to do with the setInterval function) and suddenly it doesnt work anymore! All it does is execute a function once and then stops.

Here is my code:

```auto

var sekunde:Number = 0; //seconds
var minute:Number = 0; //minutes
var intervalID:Number;
var stoparicaTece:Boolean = false; //is the stopwatch running

osveziStoparico();

function povecajSekunde(){ //increases the seconds
    sekunde++;
    if(sekunde>=60){
        minute++;
        sekunde = 0;
        if(minute >= 60){
            minute = 0;
        }
    }//1 minute
    osveziStoparico();

}
function sproziStoparico(){ //initiates the stopwatch
    if(!stoparicaTece){ //ce stoparica se ni bila pognana
        intervalID = setInterval(povecajSekunde(), 1000);
        stoparicaTece = true;
    }
}

function ustaviStoparico(){ //stops the setInterval function
    clearInterval(intervalID);
    stoparicaTece=false;
}

function resetirajStoparico(){ //resets the stopwatch
    sekunde = 0;
    minute = 0;
    osveziStoparico();
}

function osveziStoparico(){ //displays current seconds&minutes 
    stoparica.text = minute+":"+sekunde;
}

```

Thanks for your help because right now i want to hurl my computer through the window!

edit: i already tried restoring it to original state but it didnt work
