# As help with getTimer

**URL:** <https://forum.kirupa.com/t/as-help-with-gettimer/161207>\
**Category:** flash\
**Created:** [September 1, 2005, 7:59pm UTC](https://forum.kirupa.com/t/as-help-with-gettimer/161207 "2005-09-01T19:59:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wo1olf](https://avatars.discourse-cdn.com/v4/letter/w/278dde/32.png) [@wo1olf](https://forum.kirupa.com/u/wo1olf)\
**Post date:** [September 1, 2005, 7:59pm UTC](https://forum.kirupa.com/t/as-help-with-gettimer/161207/1 "2005-09-01T19:59:30Z")

</div>

Does anyone Know how to reset time in Flash?  
Because i try to make a game where i used getTimer to get the time that a player took to play the game. At the end i display the resurt in a dynamic field, including the length of the game . I’ve also put a restart button wich allow the user to replay another game. The problem that i’m having is that i can reset the time used by the player. For example if in the first game your time is 1:33 and then you replay the tim does’n t start counting on 0:00 but on 1:33 and then continue.  
here is the code

on frame 1;  
// a global variable wich will keep the value of the time  
\_global.tempsFinal = 0;

// get the time while your playing since you started playing

var intervalTime = setInterval(getSecondes, 100);

function getSecondes() {  
var my\_date:Date = new Date();  
var econdes:Number = Math.floor(getTimer()/1000)%60;  
var minutes:Number = Math.floor((getTimer()/1000)/60);  
}

// to display the time in a dynamic field

temps.text = minutes+":"+secondes;

// the code for the button to display the results  
ShowResult\_btn= function(){  
gotoAndStop(10);  
tempsFinal = minutes.toString()+":"+secondes.toString();  
}

on frame 2

this is the code on the button if you want to restart

restartBtn.onPress = function() {  
\_global.tempsFinal = 0;  
gotoAndStop(1);  
}  
Does any one knows a better way to do the same task?  
thnks  
wo1olf
