# sim-timer

> Discrete timer for simulations

Latest version **0.0.2** (published 2014-02-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install sim-timer
pnpm add sim-timer
yarn add sim-timer
bun add sim-timer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2014-02-20 |
| First published | 2014-02-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Emil Bay |
| Maintainers | emilbay |
| Keywords | timer, simulation |

## Links

- npm: https://www.npmjs.com/package/sim-timer
- Repository: http://github.com/tixz/sim-timer.js
- Homepage: https://github.com/tixz/sim-timer.js
- Issues: http://github.com/tixz/sim-timer.js/issues
- npm.io page: https://npm.io/package/sim-timer

## Recent versions

- 0.0.2 (latest) — 2014-02-20
- 0.0.1 — 2014-02-20

## README

sim-timer.js
============

Discrete timer for simulations.

Installation
------------

    npm install sim-timer


Methods
-------

#####`var t = new Timer;`

Singleton constructor for Timer.

Returns either new instance or existing instance of Timer.

#####`t.tick();`

Advance time by 1 unit, and call appropriate intervals.

Returns the new time.

#####`t.setInterval(delay, callback);`
Add a new interval to the timer. Opposed the the default Javascript
setInterval, this takes the delay first and then the callback.

`delay` time delay between calls.  
`callback` function to be called at appropriate tick.  

Returns `id` of the interval. This is used the clear the interval.

#####`t.clearInterval(id);`

Removes the interval from the timer.

`id` of the interval

Returns `Timer` for chaining.

---
_Source: https://npm.io/package/sim-timer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
