# How do I use the Timer class?

**URL:** <https://forum.kirupa.com/t/how-do-i-use-the-timer-class/230657>\
**Category:** flash\
**Created:** [June 27, 2007, 11:21pm UTC](https://forum.kirupa.com/t/how-do-i-use-the-timer-class/230657 "2007-06-27T23:21:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![willie\_wang](https://avatars.discourse-cdn.com/v4/letter/w/258eb7/32.png) [@willie\_wang](https://forum.kirupa.com/u/willie_wang)\
**Post date:** [June 27, 2007, 11:21pm UTC](https://forum.kirupa.com/t/how-do-i-use-the-timer-class/230657/1 "2007-06-27T23:21:04Z")

</div>

ok, so i have this script. I’ve instantiated a timer, set the interval times, but I want certain functions to happen at certain intervals, for example, at 2 seconds, at 5 seconds, and so on…

code looks like this, but I don’t know how to use the event handler properly. Can someone help?

```auto

import flash.utils.Timer;
import flash.utils.getTimer;
import flash.events.TimerEvent;

var myTimer:Timer = new Timer(1000,10);
myTimer.addEventListener( ************* , atTwoSeconds);
myTimer.addEventListener( ************* , atFiveSeconds);

myTimer.start();

function atTwoSeconds(event:TimerEvent):void {
 }
function atFiveSeconds(event:TimerEvent):void {
 }

```

am I even using the timer function right? can it have this functionality or am I approaching this entirely the wrong way? i assume i just need to input something simple where the \*\*\*\*\*s are, but i have no idea what.
