Global

Methods

# duration() → {string}

Source:
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}

Source:
Returns:
Type
object
Example
const Timer = require('@igorkowalczyk/countdown')
const timer = new Timer()
timer.pause()

# resume() → {object}

Source:
Returns:
Type
object
Example
const Timer = require('@igorkowalczyk/countdown')
const timer = new Timer()
timer.resume()

# start() → {object}

Source:
Returns:
Type
object
Example
const Timer = require('@igorkowalczyk/countdown')
const timer = new Timer()
timer.start(duration [, interval])

# status() → {string}

Source:
Returns:
Type
string
Example
const Timer = require('@igorkowalczyk/countdown')
const timer = new Timer()
timer.status() // return running, paused or stopped

# stop() → {object}

Source:
Returns:
Type
object
Example
const Timer = require('@igorkowalczyk/countdown')
const timer = new Timer()
timer.stop()

# time() → {string}

Source:
Returns:
Type
string
Example
const Timer = require('@igorkowalczyk/countdown')
const timer = new Timer()
timer.time() // Returns current time in ms