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.
My current solution is somewhat unsatisfactory: I use a Swing Timer
with a short duration, which I restart()
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).
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 start
on an already-started Timer
is not documented).
there as are I know only Latency that came from Native OS, if you will overflow this refresh rate then comes Error(s) from RepaintManager, btw your topic is very academic Latency is maximum refresh rate for one pixel / per seconds
but this one
or another should be good bases for testing untill / UpTo first Error(s) comings from RepaintManager (then probably lock current JVM instance) from code