public static TimerTask runAfter ( Timer timer , int delay , final Closure closure ) { TimerTask timerTask = new TimerTask ( ) { public void run ( ) { closure . call ( ) ; } } ; timer . schedule ( timerTask , delay ) ; return timerTask ; }
Allows a simple syntax for using timers . This timer will execute the given closure after the given delay .