title: Swing rate limiting
body: <p>I have a long repaint operation that I would like to rate-limit, ie make sure it gets called once every N milliseconds at most.</p>
  
  <p>My current solution is somewhat unsatisfactory: I use a Swing <code>Timer</code> with a short duration, which I <code>restart()</code> whenever I get an event. This make sure that a repaint is not triggered if events happen within an N milliseconds window (i.e. the repaint will happen after an event and an N milliseconds "quiet" period has elapsed).</p>
  
  <p>What I would like is to make sure the repaint is called at most N milliseconds after the first event and that the repaint period is at most N. Any ideas? (the effect of calling <code>start</code> on an already-started <code>Timer</code> is not documented).</p>