Class: Timer#

Hierarchy#

Constructors#

constructor#

new Timer(): Timer

Returns: Timer

Defined in: handles/timer.ts:5

Properties#

handle#

• Readonly handle: timer

Inherited from: Handle.handle

Defined in: handles/handle.ts:6

Accessors#

elapsed#

elapsed(): number

Returns: number

Defined in: handles/timer.ts:14


id#

id(): number

Get the unique ID of the handle. The ID is recycled once you destroy the object.

Returns: number

The unique ID of a handle object.

Defined in: handles/handle.ts:18


remaining#

remaining(): number

bug This might not return the correct value if the timer was paused and restarted at one point. See http://www.wc3c.net/showthread.php?t=95756.

Returns: number

Defined in: handles/timer.ts:21


timeout#

timeout(): number

Returns: number

Defined in: handles/timer.ts:25

Methods#

destroy#

destroy(): Timer

Returns: Timer

Defined in: handles/timer.ts:29


pause#

pause(): Timer

Returns: Timer

Defined in: handles/timer.ts:34


resume#

resume(): Timer

Returns: Timer

Defined in: handles/timer.ts:39


start#

start(timeout: number, periodic: boolean, handlerFunc: function): Timer

Parameters:#

NameType
timeoutnumber
periodicboolean
handlerFunc() => void

Returns: Timer

Defined in: handles/timer.ts:44


fromExpired#

static fromExpired(): Timer

bug Might crash the game if called when there is no expired timer.

Returns: Timer

Defined in: handles/timer.ts:52


fromHandle#

static fromHandle(handle: timer): Timer

Parameters:#

NameType
handletimer

Returns: Timer

Defined in: handles/timer.ts:56