Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shiplunc/6e2dbe521a0b2445d0e8 to your computer and use it in GitHub Desktop.
Save shiplunc/6e2dbe521a0b2445d0e8 to your computer and use it in GitHub Desktop.
#!/bin/bash
interval=10
times=6
cmd="/path/to/node /path/to/script.js"
start_time=$(date +"%s")
$cmd
for t in `seq $(($times - 1))`
do
end_time=$(date +"%s")
sleep $(($interval - $(($end_time - $start_time))))s
start_time=$(date +"%s")
$cmd
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment