Know When Timer Is Finished?

Is there a method or property to know when a timer has finished all of its iterations?

For instance:

timer.performWithDelay(math.random(1000,10000), myFunction, math.random(1,10))

How can I know when this timer is finished all iterations?

You need to capture the value of math.random(1,10) to a value.  The in myFunction, increment a counter and test to see if the counter is greater than the iterations returned my math.random()

Ah, I see.  I was hoping there was a “Corona” way to do it :slight_smile:

A timer is finished when it makes a ding noise and you hear ticking when it is going like the one we have in the kitchen.

@Bud.hooke:

:smiley:

We can’t take all the programming away :slight_smile:

Sure you can, you guys are Corona Labs!  :slight_smile:

Another question. I am using this timer in a Storyboard.  There is a comment in the Storyboard template that says to cancel timers in exitScene.  I assume this means only timers with infinite iterations, correct?  Would my timer, with say 10 iterations, still be in memory after it finishes all iterations?

Any timer that is still running needs cancelling with timer.cancel on leaving scene.

Sorry my big brother who normally helps me with corona was being an idiot yesterday I know what a timer is in corona.

@bud.hooke:

:smiley:

You need to capture the value of math.random(1,10) to a value.  The in myFunction, increment a counter and test to see if the counter is greater than the iterations returned my math.random()

Ah, I see.  I was hoping there was a “Corona” way to do it :slight_smile:

A timer is finished when it makes a ding noise and you hear ticking when it is going like the one we have in the kitchen.

@Bud.hooke:

:smiley:

We can’t take all the programming away :slight_smile:

Sure you can, you guys are Corona Labs!  :slight_smile:

Another question. I am using this timer in a Storyboard.  There is a comment in the Storyboard template that says to cancel timers in exitScene.  I assume this means only timers with infinite iterations, correct?  Would my timer, with say 10 iterations, still be in memory after it finishes all iterations?

Any timer that is still running needs cancelling with timer.cancel on leaving scene.

Sorry my big brother who normally helps me with corona was being an idiot yesterday I know what a timer is in corona.

@bud.hooke:

:smiley: