Fuze Arena Logo
  • Forum
  • Creations
    Catalogue Showcase
  • Help

setTimer()

Purpose

Create a new timer

Description

Create a new timer which is used to call a function a number of times with a fixed interval

Syntax

handle = setTimer( interval, count, functionName( arguments ) )

Arguments

handle The handle of the timer

interval The interval between each function call

count The number of times to call the function

functionNameThe function to call

arguments The arguments to pass to the function

Example

count = 10
handle = setTimer( 1, 11, showCount() )
stopTimer( handle )

loop
    c = controls( 0 )
    printAt( 0, 0, "Press A to start timer" )
    if c.a then
        startTimer( handle )
    endIf
    printAt( 0, 1, "Press B to stop timer" )
    if c.b then
        stopTimer( handle )
    endIf
    update()
repeat

function showCount()
    clear()
    textSize( 500 )
    printAt( tWidth() / 2, tHeight() / 2, count )
    textSize( 29 )
    count -= 1
return void

Associated Commands

clock(), sleep(), startTimer(), stopTimer(), time()

logo

©2019 FUZE Technologies Ltd. FUZE is a registered trademark of FUZE Technologies Ltd. All rights reserved.

Useful links

  • Fuze Main Site
  • Fuze Arena on Twitter
  • Fuze Arena on Youtube
  • Download Buyer

Contact Information

  • FUZE Technologies Ltd
    15 Clearfields Farm
    Wotton Underwood
    Aylesbury, Buckinghamshire
    ​England, HP18 0RS

  • +44 (0) 1844 239 432

  • contact@fuze.co.uk

© Copyright FUZE Technologies Ltd. All rights reserved.