Skip to content
/ Timers Public

JavaScript library to list all πŸ•“ timers (timeouts/intervals); replaces build in setTimeout/setInterval)

Notifications You must be signed in to change notification settings

docjojo/Timers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Timers

https://github.com/docjojo/_timers/

Timers javascript library to list all timers (timeouts/intervals) (c) 2023 by Chris Ahrweiler

Version

Timers v1.01b | 231115 | Renamed from _timers to Timers and turned into function Timers v1.0b | 231115

Usage

Place the script in your head tag

<head>
  <script src="./timers.min.js"></script>
</head>

This will replace the build in functions window.setTimeout and windows.setInterval with new functions of the same name. There is no need to change code to timers, so setTimeout(()=> { console.log('test'; }) stays the same, but now, _timers keeps track of those calls.

Call Timers.list() in your script or the browser console to show a table of all timers registered since the start of your code.

Optional: Call Timers.listInterval(delay) to set interval with delay in milliseconds on calling Timers.list(). Example const timersTest = Timers.listInterval(30000);

Features

  • Timers has a build in auto-cleanup function for outdated (15 seconds) and cleared timers.
  • Timers will prevent clearing undefined timers and show an ID is undefined error on the console window.

END

About

JavaScript library to list all πŸ•“ timers (timeouts/intervals); replaces build in setTimeout/setInterval)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published