# Does stopping a timer remove its listeners as well?

**URL:** <https://forum.kirupa.com/t/does-stopping-a-timer-remove-its-listeners-as-well/316011>\
**Category:** Uncategorized\
**Created:** [November 10, 2010, 6:21am UTC](https://forum.kirupa.com/t/does-stopping-a-timer-remove-its-listeners-as-well/316011 "2010-11-10T06:21:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThreeDollarBill](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@ThreeDollarBill](https://forum.kirupa.com/u/ThreeDollarBill)\
**Post date:** [November 10, 2010, 6:21am UTC](https://forum.kirupa.com/t/does-stopping-a-timer-remove-its-listeners-as-well/316011/1 "2010-11-10T06:21:28Z")

</div>

just cause i’m trying to optimize my project to the fullest (concerned about garbage collection and all that…), i want to know something about timers…

is the killTimer function enough? or do i also have to remove the listeners?

```php

var theTimer:Timer;
       
function startTimer():void
{
    theTimer = new Timer(1000);
    theTimer.addEventListener(TimerEvent.TIMER, timerRan);
    theTimer.start();
}

function killTimer():void
{
    theTimer.stop();
    theTimer = null;
}

function timerRan(event:TimerEvent):void
{
    // do something...
}

```
