timers.Reset

( Brutus2D all versions? )

timers.Reset - resets a timer

Description

timers.Reset index

  • index - the index of the timer

timers.Reset resets a timer. It does not matter if the timer has been paused or not. index is the index of the timer as returned by timers.Create(). The timer is automatically started again.

Examples

graphics.Initialize
key.Initialize
mouse.initialize

Dim font
font = graphics.CreateFont ( "system", 10 )

t = timers.Create

Do
    mouse.Update
    If mouse.LeftButton Then timers.Hold t
    If mouse.RightButton Then timers.Start t
    If mouse.MiddleButton Then timers.Reset t

    graphics.Clear
    graphics.SetText "Use mouse buttons to control: left=hold, right=start, middle=reset", 10, 10, font
    graphics.SetText "Time elapsed on timer: " & timers.AppTime( t ), 10, 30, font
    graphics.Display
Loop Until key.Pressed ( vk_escape ) Or key.Pressed ( vk_windowx )

key.Terminate
graphics.Terminate

Related Pages

page tags: reset timer
page_revision: 1, last_edited: 1214669617|%e %b %Y, %H:%M %Z (%O ago)