Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eins78/node-hertz

miliseconds from frequency (1000/n)
https://github.com/eins78/node-hertz

Last synced: about 1 month ago
JSON representation

miliseconds from frequency (1000/n)

Awesome Lists containing this project

README

        

# *require*("**hertz**")

[![fanart](http://upload.wikimedia.org/wikipedia/commons/e/ea/Wave_frequency.gif)](https://en.wikipedia.org/wiki/Hertz)

sick of writing `setTimeout(fn, (1000/freq))`?

use this:

```js
var hz = require('hertz');
setTimeout(fn, hz(1));
```
### async

async version, because `node.js`:

```js
var hz = require('hertz/async');
hz(1, function (err, wait) {
setTimeout(fn, wait);
});
```

##### Build Status

Travis: [![travis ci](https://travis-ci.org/eins78/node-hertz.svg)](https://travis-ci.org/eins78/node-hertz)

[![cider ci](http://cider.zrh.kiste.li/cider-ci/ui/public/node-hertz/master/test/summary.svg?respond_width_200)](http://cider.zrh.kiste.li/cider-ci/ui/public/node-hertz/master/test/summary.html)