Constructor
# new VariableDuration(from, toopt)
Create and start the duration timer immediately.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
from |
Number | start of the duration range in seconds. |
|
to |
Number |
<optional> |
end of the duration range in seconds. |
Example
// Create a duration that will be somewhere between 10 and 20 seconds.
const duration = new VariableDuration(10, 20);
// ...
if (!duration.complete) {
// ...
}