All Projects → colyseus → timer

colyseus / timer

Licence: MIT license
Timing Events tied to @gamestdio/clock

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to timer

driftless
Driftless setInterval and setTimeout replacement for Node and the browser
Stars: ✭ 67 (+235%)
Mutual labels:  settimeout, setinterval
chronoman
Utility class to simplify use of timers created by setTimeout
Stars: ✭ 15 (-25%)
Mutual labels:  settimeout, setinterval
timer-miniprogram
小程序定时器管理库,更合理地使用 setTimeout 和 setInterval,在页面显示时重启定时器,页面隐藏时暂停定时器,页面卸载时清除定时器
Stars: ✭ 26 (+30%)
Mutual labels:  settimeout, setinterval
audio-context-timers
A replacement for setInterval() and setTimeout() which works in unfocused windows.
Stars: ✭ 12 (-40%)
Mutual labels:  settimeout, setinterval
time
The simplest but configurable online clock
Stars: ✭ 77 (+285%)
Mutual labels:  clock
Clock Bar
Macbook | Clock, right on the touch bar
Stars: ✭ 237 (+1085%)
Mutual labels:  clock
Cornercal
A simple, clean calendar and clock app for macOS.
Stars: ✭ 213 (+965%)
Mutual labels:  clock
Hgcircularslider
A custom reusable circular / progress slider control for iOS application.
Stars: ✭ 2,240 (+11100%)
Mutual labels:  clock
1440-clock
Simple JavaScript clock that visualizes the 1440 minutes one has in a day
Stars: ✭ 49 (+145%)
Mutual labels:  clock
clocklet
An opinionated clock-style vanilla-js timepicker.
Stars: ✭ 31 (+55%)
Mutual labels:  clock
pink-0
Ableton Link to clock/reset signals converter
Stars: ✭ 87 (+335%)
Mutual labels:  clock
Grid Clock Screensaver
Grid clock macOS screensaver
Stars: ✭ 245 (+1125%)
Mutual labels:  clock
worldclock
A Sci-fi looking World Clock created using JavaFX.
Stars: ✭ 28 (+40%)
Mutual labels:  clock
Evangelion Clock Screensaver
A digital clock screensaver inspired by the graphical interfaces from Neon Genesis Evengelion.
Stars: ✭ 234 (+1070%)
Mutual labels:  clock
twigs
Alternate firmware for Mutable Instruments Branches synthesizer module
Stars: ✭ 21 (+5%)
Mutual labels:  clock
Marquee Scroller
Marquee Scroller Clock News Weather and More
Stars: ✭ 211 (+955%)
Mutual labels:  clock
LWClock
Multifunctional clock based on ESP8266 and MAX79xxx for Home Automation (IoT)
Stars: ✭ 40 (+100%)
Mutual labels:  clock
Takvim-saat-chrome-extensions
😎 Anlık olarak takvim, saat ve hava durumu bilgilerinizi tarayıcınızın newtab alanında tutarak kullanımı oldukça kolay bir ortam oluşturur. extensions link:
Stars: ✭ 21 (+5%)
Mutual labels:  clock
ColorClockSaver
A screensaver for macOS
Stars: ✭ 57 (+185%)
Mutual labels:  clock
ardusamber
Desamber time Arduino corporealization
Stars: ✭ 20 (+0%)
Mutual labels:  clock

@gamestdio/timer Build Status

Timing Events tied to @gamestdio/clock.

ClockTimer is a subclass of Clock, which adds methods to handle timeout and intervals relying on Clock's ticks.

Why?

Once built-in setTimeout and setInterval relies on CPU load, functions may delay an unexpected amount of time to execute. Having it tied to a clock's time is guaranteed to execute in a precise way.

See a quote from W3C Timers Specification:

This API does not guarantee that timers will fire exactly on schedule. Delays due to CPU load, other tasks, etc, are to be expected.

API

Clock

  • setInterval(handler, time, ...args) -> Delayed
  • setTimeout(handler, time, ...args) -> Delayed
  • clear() - clear all intervals and timeouts.

Delayed

  • clear() -> void - Clear timeout/interval
  • reset() -> void - Reset elapsed time
  • active -> Boolean - Is it still active?
  • pause() -> void - Pause the execution
  • resume() -> void - Continue the execution
  • paused -> Boolean - Is is paused?

License

MIT

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].