Object built-in object

Object Timer

Timer handler object

Inheritance

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 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