Skip to content

Home > @esengine/ecs-framework-monorepo > Timer

Timer class

私有类隐藏ITimer的实现

Signature:

typescript
export declare class Timer<TContext = unknown> implements ITimer<TContext>

Implements: ITimer<TContext>

Properties

Property

Modifiers

Type

Description

_elapsedTime

number

_isDone

boolean

_onTime

(timer: ITimer<TContext>) => void

_repeats

boolean

_timeInSeconds

number

context

TContext

elapsedTime

readonly

number

定时器已运行的时间

isDone

readonly

boolean

定时器是否已完成

Methods

Method

Modifiers

Description

getContext()

initialize(timeInsSeconds, repeats, context, onTime)

reset()

stop()

tick()

unload()

空出对象引用,以便在js需要时GC可以清理它们的引用

基于 MIT 许可证发布