Fudge Core
    Preparing search index...

    Class Timer

    A Timer-instance internally uses window.setInterval to call a given handler with a given frequency a given number of times, passing an EventTimer-instance with additional information and given arguments. The frequency scales with the Time-instance the Timer-instance is attached to.

    Jirka Dell'Oro-Friedl, HFU, 2019

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    • Creates a Timer instance.

      Parameters

      • _time: Time

        The Time instance, the timer attaches to

      • _elapse: number

        The time in milliseconds to elapse, to the next call of _handler, measured in _time

      • _count: number

        The desired number of calls to _handler, Timer deinstalls automatically after last call. Passing 0 invokes infinite calls

      • _handler: TimerHandler

        The TimerHandler instance to call

      • ..._arguments: Object[]

        Additional arguments to pass to _handler

        TODO: for proper handling and deletion, use Time.setTimer instead of instantiating timers yourself.

      Returns Timer

    Properties

    active: boolean
    count: number

    Accessors

    Methods