clearTick

Removes a tick timer, stopping it from running. This is to be used in combination with a setTick id.

Syntax

clearTick(id);

Required arguments

  • id: The timer to be cleared.

Examples

This example creates a tick timer that prints a string to the console. We then clear it 5000ms after the server/client started.

const timer = setTick(() => {
  console.log("I'm running.");
});

setTimeout(() => {
  clearTick(timer);
  console.log('I stopped running.');
}, 5000);