Last active
August 29, 2015 14:23
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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