Stuck on this timer code! Please help!

Hi all!

I’m using this timer code for my project but im having a little problem understanding several of the lines. This code was attached to a frame on the main timeline, and a movie clip called my_mc placed on the stage. Can anyone explain in detail what is happening and why for each of the lines in red? Thanks for any help! Much appreciated.

[COLOR=red]t0 = getTimer();

this.onEnterFrame = function(){

var t1 = getTimer() - t0;
var s1 = Math.round(t1 / 1000);[/COLOR]
var t2 = 60 - s1;
if (t2 <= 0)

delete this.onEnterFrame;
t2 = 0;

my_mc.swapDepths(666);
my_mc.removeMovieClip();

trace(t2);
};

getTimer() starts the timer in t0
gettimer returns the time elapsed since creation of t0…but its in miliseconds
so divide by 1000 = seconds

t0 = getTimer();

getTimer() function returns number of milliseconds till start of the flash movie

this.onEnterFrame = function(){

assings to “this” an onEnterFrame… it is following code terminated with “};” on the last line. This function is called on every frame.

var t1 = getTimer() - t0;

This assings to variable “t1” time since “t0” was declared… it gets higher every frame

var s1 = Math.round(t1 / 1000);

This assings to “s1” converted value of “t1” from milliseconds to seconds as 1 second = 1000 milliseconds.

Do you need something more or is it clear enough?