# What's wrong with this Timer syntax?

**URL:** <https://forum.kirupa.com/t/whats-wrong-with-this-timer-syntax/249802>\
**Category:** flash\
**Created:** [January 22, 2008, 5:33pm UTC](https://forum.kirupa.com/t/whats-wrong-with-this-timer-syntax/249802 "2008-01-22T17:33:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lkingman](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@lkingman](https://forum.kirupa.com/u/lkingman)\
**Post date:** [January 22, 2008, 5:33pm UTC](https://forum.kirupa.com/t/whats-wrong-with-this-timer-syntax/249802/1 "2008-01-22T17:33:09Z")

</div>

This function locks up in the while loop, presumably because myTimer.running remains true. This timer should run once, for two seconds, correct? I probably shouldn’t post when I’m tired, probably an obvious, glaring error, but I have to get this done. Thanks for any help.

```
	function timeOut() {
		import flash.utils.Timer;
		var myTimer:Timer=new Timer(2000,1)
		myTimer.start()
		while (myTimer.running==true) {}
                    // do something ...
	}
```
