Skip to content

Instantly share code, notes, and snippets.

@greatseth
Created November 15, 2012 23:15
Show Gist options
  • Select an option

  • Save greatseth/4082253 to your computer and use it in GitHub Desktop.

Select an option

Save greatseth/4082253 to your computer and use it in GitHub Desktop.
next_run = nil
interval = 60 * 15
loop do
if next_run.nil? or (next_run.to_i < Time.new.to_i)
next_run = Time.new.to_i + interval
# do stuff
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment