Timer (problem)

I have this code for my timer, it counts down alright. BUT it is very buggy it most commonly counts down by 2 when it is meant to count down by one:*( I have even watched my brother play our game and it went fron 20 to 7!!! any help would be greatly appreciated. If anyone could even give a code that counts down in minutes and seconds would be majorly appreciated. But yeh, I don’t know what is causing it so please help a man in need LOL:D

   
var cur_timer = 180;
function timer() {
if (cur_timer > 0) {
 cur_timer--;
} else {
 cur_timer = "Time up!";
 gotoAndPlay("43")
 clearInterval (time_interval);
}
}
time_interval = setInterval(timer, 1000);