How to implement idle task in Java Swing
问题 I have a GUI app that is getting to be quite slow. I want to start introducing timing for various GUI tasks - however, many of our GUI actions trigger other actions which then "invoke later" to trigger other actions. Eventually, it all settles down and there's nothing more to do. At this time, I want to stop a timer and report how long that GUI "action" took. I figured the way to do this is to implement a method called invokeOnceIdle(Runnable task) . The method will execute the supplied task