https://github.com/langhuihui/timer
https://github.com/langhuihui/timer
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/langhuihui/timer
- Owner: langhuihui
- License: apache-2.0
- Created: 2023-10-04T02:27:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-20T07:56:53.000Z (over 1 year ago)
- Last Synced: 2025-03-15T15:48:45.080Z (about 1 month ago)
- Language: TypeScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Getting Started
```
npm install wtimer
```# Example
```ts
import createInterval from 'wtimer';// init
const wtimer = createInterval(10); // 10ms interval in worker// set interval
const p = wtimer.setInterval(() => {
console.log('Hello World');
}, 1000);
// clear interval
wtimer.clearInterval(p);// clear all interval
wtimer.terminate();