mikeal/watch

readme.mkd is wrong about interval units

mx-scissortail opened this issue · 4 comments

The documentation says:

'interval' - Specifies the interval duration in seconds, the time period between polling for file changes.

But interval is actually passed through to fs.watchFile, where it's interpreted as milliseconds (not seconds). Putting in a value of "1" for interval increased my CPU load somewhat unexpectedly.

Note that it is multiplied by 1000 to convert it into seconds:

https://github.com/mikeal/watch/blob/master/cli.js#L37

Ah - if it's passed in as an arg (not from the cli) it's not multiplied. That must be what confused me.

PR coming.