1.0.1 • Published 10 months ago
@wavelink_/timer v1.0.1
Timer library
This library provides several timing functions. Every timer creates its own thread, where it runs its process. There are severeal types of timers available:
- timeout -> A timeout, that checks for elapsed time using a while loop, ussually very accurate
- timeout-effecient -> A timout that runs the normal setTimeout, possible less accurate, but doesn't use much resources
- timeout-mixed -> A mix of the 2 above, for a majority of the timeout, it uses setTimeout, but at the end of the timeout it uses the while loop approach the get the deviance to 0ms, very precise, pretty effecient.
The same types of loops are availbe for intervals.
This library uses a worker under the hood, so it is possible that there can be location problems when trying to import the worker.
Tests
the /tests directory contains several html files, that demosntrate the use of this library, and test the accuracy.