title: Distinction between ScheduledExecutorService and rolling your own Runnable with Thread.sleep()
body: <p>What are the benefits of using <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ScheduledExecutorService.html" rel="nofollow"><code>ScheduledExecutorService</code></a>'s <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ScheduledExecutorService.html#scheduleAtFixedRate-java.lang.Runnable-long-long-java.util.concurrent.TimeUnit-" rel="nofollow"><code>scheduleAtFixedRate()</code></a> to run a piece of code on a regular basis instead of creating a new <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html" rel="nofollow"><code>Runnable</code></a> that has a forever loop coupled with a <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#sleep-long-" rel="nofollow"><code>Thread.sleep()</code></a> that causes the thread to sleep for the desired period?</p>
  
  <p>Is there a performance gain with one of the methods?</p>