$customHeader
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Queues are timers...

 The queue() function uses the timer functionality behind the scenes, so when you use removeTimer() it will remove both timers and queues for the specified function.

Overview

Allows you to cancel all timers associated with a specific function.

If there are multiple timers associated with a specific function, it's not possible to cancel one specific timer.

Syntax

removeTimer(functionName);

Parameters

ParameterMandatoryTypeDescription
functionName(tick)String

All timers (including queued function calls) associated with the named function (referenced by it's name in quotes) will be cancelled.

Return value

ValueTypeDescription
undefinedUndefinedThe timers/queues associated with the function have been removed.
<error>ErrorDid you forget to specify functionName as a string?

Example

Setting / removing a timer
function foo() {
  // do stuff
}

setTimer("foo",1000);
 
removeTimer("foo"); // cancel all timers that relate to function "foo"

See also

  • No labels