Simple utility for only executing code every so often.