use ms instead of secs for sleep (fix #2)