# Timing and Waiting

**URL:** <https://forum.kirupa.com/t/timing-and-waiting/180728>\
**Category:** flash\
**Created:** [March 3, 2006, 1:56am UTC](https://forum.kirupa.com/t/timing-and-waiting/180728 "2006-03-03T01:56:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fm47](https://avatars.discourse-cdn.com/v4/letter/f/50afbb/32.png) [@fm47](https://forum.kirupa.com/u/fm47)\
**Post date:** [March 3, 2006, 1:56am UTC](https://forum.kirupa.com/t/timing-and-waiting/180728/1 "2006-03-03T01:56:03Z")

</div>

How do i do timing and waiting without having to figure out my frame rate and then tween everything to it?

How would I wait in seconds? Do I have to get the time, save that to a variable, then once it’s, for example, 3 seconds later, something set to work 3 seconds later will start?

myTime = new Date();  
startTime = myTime.getSeconds();  
endTimer = myTime.getSeconds();

onPress = function () {  
delay = 3;  
a = startTime;  
b = endTime + delay  
if (a == b) {  
trace (“it’s been " + delay + " seconds!”);  
}  
}

would that work?
