Object Timer
Timer handler object
Inheritance
Member attributes
stopped
Boolean, query whether the current timer has expired
1readonly Boolean Timer.stopped;
Member function
ref
Keep the fibjs process from exiting, and prevent the fibjs process from exiting during the timer waiting period
1Timer 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
1Timer Timer.unref();
Return result:
- Timer, Returns the timer object
clear
Cancel the current timer
1Timer.clear();
toString
Returns the string representation of the object, generally returns "[Native Object]", the object can be re-implemented according to its own characteristics
1String 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
1Value Timer.toJSON(String key = "");
Call parameters:
- key: String, unused
Return result:
- Value, Returns a value containing JSON serializable