Methods
# duration() → {string}
Returns:
- Type
- string
Example
const Timer = require('@igorkowalczyk/countdown')
const timer = new Timer()
timer.duration() // Return the total duration of the timer in ms
# pause() → {object}
Returns:
- Type
- object
Example
const Timer = require('@igorkowalczyk/countdown')
const timer = new Timer()
timer.pause()
# resume() → {object}
Returns:
- Type
- object
Example
const Timer = require('@igorkowalczyk/countdown')
const timer = new Timer()
timer.resume()
# start() → {object}
Returns:
- Type
- object
Example
const Timer = require('@igorkowalczyk/countdown')
const timer = new Timer()
timer.start(duration [, interval])
# status() → {string}
Returns:
- Type
- string
Example
const Timer = require('@igorkowalczyk/countdown')
const timer = new Timer()
timer.status() // return running, paused or stopped
# stop() → {object}
Returns:
- Type
- object
Example
const Timer = require('@igorkowalczyk/countdown')
const timer = new Timer()
timer.stop()
# time() → {string}
Returns:
- Type
- string
Example
const Timer = require('@igorkowalczyk/countdown')
const timer = new Timer()
timer.time() // Returns current time in ms