Represents a time delay with a specific value and unit TimeUnits.
The Delay class allows for creating and manipulating time delay representations using various time units from nanoseconds to hours.
// Create delays using different time unitsconst shortDelay = new Delay(500, TimeUnits.MILLISECONDS);const longDelay = new Delay(2, TimeUnits.HOURS);console.log(shortDelay.toString()); // Outputs: "500ms"console.log(longDelay.toString()); // Outputs: "2h" Copy
// Create delays using different time unitsconst shortDelay = new Delay(500, TimeUnits.MILLISECONDS);const longDelay = new Delay(2, TimeUnits.HOURS);console.log(shortDelay.toString()); // Outputs: "500ms"console.log(longDelay.toString()); // Outputs: "2h"
Represents a time delay with a specific value and unit TimeUnits.
Remarks
The Delay class allows for creating and manipulating time delay representations using various time units from nanoseconds to hours.
Example