Constructor
# new Timer(timeLeftopt)
Create a timer object set time passed in
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
timeLeft |
Number |
<optional> |
How much time left before the timer elapses in seconds |
- Source:
Methods
# active() → {Boolean}
Returns true if set and has not elapsed
- Source:
Returns:
- Type
- Boolean
# elapsed() → {Boolean}
Returns true if set and elapsed
- Source:
Returns:
- Type
- Boolean
# get() → {Number}
Get how long since elapsed, returns 0 if not set
- Source:
Returns:
- Type
- Number
# getPercent() → {Number}
Get percentage elapsed based on time it was set to, returns 0 if not set
- Source:
Returns:
- Type
- Number
# isSet() → {Boolean}
Returns true if set
- Source:
Returns:
- Type
- Boolean
# set(timeLeftopt)
Set the timer with seconds passed in
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
timeLeft |
Number |
<optional> |
0 | How much time left before the timer is elapsed in seconds |
- Source:
# unset()
Unset the timer
- Source: