Creating a TimerTask can not get easier than this thanks to groovy.
import java.util.timer.*is not required as java.util is already imported.- the
run()is implemented as closure
To Run this:
groovy https://gist.github.com/kdabir/3176945/raw/timer_example.groovy