Object built-in object

Object Timer

Timer handler object

Inheritance

#lineWidth: 1.5 #font: Helvetica,sans-Serif #fontSize: 10 #leading: 1.6 #.this: fill=lightgray #.class: fill=white [<class>object|toString();toJSON()] [<this>Timer|stopped|ref();unref();clear()] [object] <:- [Timer] Timer stopped ref() unref() clear() object toString() toJSON()

Member attributes

stopped

Boolean, query whether the current timer has expired

1
readonly Boolean Timer.stopped;

Member function

ref

Keep the fibjs process from exiting, and prevent the fibjs process from exiting during the timer waiting period

1
Timer Timer.ref();

Return result:

  • Timer, Returns the timer object

unref

Allow the fibjs process to exit, and allow the fibjs process to exit during the timer waiting period

1
Timer Timer.unref();

Return result:

  • Timer, Returns the timer object

clear

Cancel the current timer

1
Timer.clear();

toString

Returns the string representation of the object, generally returns "[Native Object]", the object can be re-implemented according to its own characteristics

1
String Timer.toString();

Return result:

  • String, Returns the string representation of the object

toJSON

Returns the JSON format representation of the object, generally returns a collection of readable attributes defined by the object

1
Value Timer.toJSON(String key = "");

Call parameters:

  • key: String, unused

Return result:

  • Value, Returns a value containing JSON serializable