make Ruby script run once a second
- by Matt Hintzke
I have a ruby script that needs to run about 1 time a second. What I am doing is using a ruby script to keep track of modifications of files in a directory. I want the script to run once a second so that the modifications are updated in "live" time.
Basically, I want my script to do the same kind of thing as running "top" on a unix shell. Where the screen is updated every second or so. Is there an equivalent to setInterval in ruby like there is in javascript?
Thanks