Javascript timer with extended features.
Control is yours now!

Documentation

Welcome to documentation of overtimer. I want to share some informations about documentation before start. Type of the time is milliseconds in everywhere 1000 ms = 1 second. Code fields in the documentation are written in ECMAScript 6 ( es6 ). If you didn't learned es6 yet, you can start from here. . Lastly, you can set debug variable to true for display warning messages in developer console. ( F12 )

Simple Usage

  new Overtimer(1000, () => {
    $('#example1-success-box').transition('fade')
  })

Repeat, Percentage, Pause and Resume

  let example2Timer = new Overtimer(4000, {repeat: 3, start: false})
  example2Timer.on('poll', () => {
    $('#example2-current-repeat').text(example2Timer.currentRepeat)
    $('#example2-current-repeat-elapsed').text(`${example2Timer.elapsedTime} ms`)
    $('#example2-total-elapsed').text(`${example2Timer.totalElapsedTime} ms`)
    $('#example2-current-repeat-remaining-time').text(`${example2Timer.remainingTime} ms`)
    $('#example2-total-remaining-time').text(`${example2Timer.totalRemainingTime} ms`)

    $('#example2-current-repeat-remaining-time-percentage').progress({ percent: Math.ceil(example2Timer.currentRepeatPercent) })
    $('#example2-total-remaining-time-percentage').progress({ percent: Math.ceil(example2Timer.totalPercent) })
  })
Current Repeat:
0
Current Repeat Elapsed: 0 ms
Total Elapsed: 0 ms
Total Paused: 0 ms
Current Repeat Remaining: 0 ms
Total Remaining Time: 0 ms

New documentation topics on the way. Stay in touch...