Object built-in object

ObjectTimer

timer handler object

inheritance relationship

member properties

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 while the timer is waiting.

1
Timer Timer.ref();

Return results:

  • 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 results:

  • Timer, returns the timer object

clear

Cancel current timer

1
Timer.clear();

toString

Returns the string representation of the object. Generally, "[Native Object]" is returned. The object can be re-implemented according to its own characteristics.

1
String Timer.toString();

Return results:

  • String, returns the string representation of the object

toJSON

Returns a JSON format representation of the object, generally returning a collection of readable properties defined by the object.

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

Call parameters:

  • key: String, not used

Return results:

  • Value, returns a value containing JSON serializable