Skip to content

Instantly share code, notes, and snippets.

@alorma
Last active August 29, 2015 14:23
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 alorma/9032de29e9f51d29e051 to your computer and use it in GitHub Desktop.
Save alorma/9032de29e9f51d29e051 to your computer and use it in GitHub Desktop.
Snippet that show a good way to run a Runnable in a fixed rate time
ScheduledExecutorService executorService = Executors.newScheduledThreadPool(5);
executorService.scheduleAtFixedRate(runnable, 0, 5, TimeUnit.SECONDS);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment