All Projects → mathiasvr → tiny-timer

mathiasvr / tiny-timer

Licence: MIT license
🕑 Small countdown timer and stopwatch module.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to tiny-timer

Countdownlabel
Simple countdown UILabel with morphing animation, and some useful function.
Stars: ✭ 714 (+1730.77%)
Mutual labels:  countdown, timer
react-timer-wrapper
Composable React Timer component that passes status props to children, in addition to some basic callbacks. Can be used at a countdown timer ⏲ or as stopwatch ⏱ to track time while active.
Stars: ✭ 14 (-64.1%)
Mutual labels:  countdown, timer
Termdown
Countdown timer and stopwatch in your terminal
Stars: ✭ 749 (+1820.51%)
Mutual labels:  countdown, timer
react-component-countdown-timer
This is a simple count down timer react component.
Stars: ✭ 18 (-53.85%)
Mutual labels:  countdown, timer
React Timer Hook
React timer hook
Stars: ✭ 118 (+202.56%)
Mutual labels:  countdown, timer
Web-Time-Tracker
Plugin named Timetracker is a time counter that works in both increase and decrease directions.
Stars: ✭ 21 (-46.15%)
Mutual labels:  countdown, timer
CountdownTimer-TeLeTiPs
The very first powerful Telegram bot to countdown to your important events in any group chat. Live countdown timer (days : hours : minutes : seconds)
Stars: ✭ 122 (+212.82%)
Mutual labels:  countdown, timer
Aospdeskclock
Fork of aosp deskclock: alarm,clock, timer,stopwatch
Stars: ✭ 28 (-28.21%)
Mutual labels:  timer, stopwatch
Use Timer
A timer hook for React
Stars: ✭ 113 (+189.74%)
Mutual labels:  countdown, timer
Flip Clock
A flip clock, timer and countdown made with Polymer
Stars: ✭ 69 (+76.92%)
Mutual labels:  countdown, timer
alfred-timer-workflow
Alfred workflow to start a timer, which blinks when the time is up.
Stars: ✭ 39 (+0%)
Mutual labels:  countdown, timer
React Native Countdown Component
React Native CountDown
Stars: ✭ 193 (+394.87%)
Mutual labels:  countdown, timer
use-countdown-timer
React hook exposing a countdown timer with optional expiration reset callbacks
Stars: ✭ 31 (-20.51%)
Mutual labels:  countdown, timer
Easytimer.js
Easy to use Timer/Stopwatch/Countdown library compatible with AMD, ES6 and Typescript
Stars: ✭ 562 (+1341.03%)
Mutual labels:  countdown, timer
new-clock
The best clock app there is
Stars: ✭ 24 (-38.46%)
Mutual labels:  timer, stopwatch
React Countdown
React Component showing a countdown to certain date and time.
Stars: ✭ 58 (+48.72%)
Mutual labels:  countdown, timer
timezz
With this plugin, you can easily make a stopwatch or timer on your site. Just init, style and enjoy.
Stars: ✭ 35 (-10.26%)
Mutual labels:  timer, stopwatch
Countdowntask
⌛️A countdown library for Android.
Stars: ✭ 64 (+64.1%)
Mutual labels:  countdown, timer
Flipdown
⏰ A lightweight and performant flip styled countdown clock
Stars: ✭ 136 (+248.72%)
Mutual labels:  countdown, timer
React Countdown Circle Timer
Lightweight React/React Native countdown timer component with color and progress animation based on SVG
Stars: ✭ 220 (+464.1%)
Mutual labels:  countdown, timer

tiny-timer

npm Build Status Dependency status downloads license

Small countdown timer and stopwatch module.

Installation

npm:

$ npm install tiny-timer

Yarn:

$ yarn add tiny-timer

Example

const Timer = require('tiny-timer')

const timer = new Timer()

timer.on('tick', (ms) => console.log('tick', ms))
timer.on('done', () => console.log('done!'))
timer.on('statusChanged', (status) => console.log('status:', status))

timer.start(5000) // run for 5 seconds

Usage

timer = new Timer({ interval: 1000, stopwatch: false })

Optionally set the refresh interval in ms, or stopwatch mode instead of countdown.

timer.start(duration [, interval]) {

Starts timer running for a duration specified in ms. Optionally override the default refresh interval in ms.

timer.stop()

Stops timer.

timer.pause()

Pauses timer.

timer.resume()

Resumes timer.

Events

timer.on('tick', (ms) => {})

Event emitted every interval with the current time in ms.

timer.on('done', () => {})

Event emitted when the timer reaches the duration set by calling timer.start().

timer.on('statusChanged', (status) => {})

Event emitted when the timer status changes.

Properties

timer.time

Gets the current time in ms.

timer.duration

Gets the total duration the timer is running for in ms.

timer.status

Gets the current status of the timer as a string: running, paused or stopped.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].