Last active
November 20, 2017 08:26
Revisions
-
kdabir revised this gist
Feb 8, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,4 +5,4 @@ Creating a `TimerTask` can not get easier than this thanks to groovy. To Run this: `groovy https://gist.github.com/kdabir/3176945/raw/timer_example.groovy` -
kdabir revised this gist
Feb 8, 2013 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,3 +3,6 @@ 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 -
kdabir revised this gist
Jul 25, 2012 . 2 changed files with 5 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ 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 This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,3 @@ def count = 0 new Timer().schedule({ -
kdabir created this gist
Jul 25, 2012 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ import java.util.timer.* def count = 0 new Timer().schedule({ println count++ } as TimerTask, 1000, 3000) //magic numbers are initial-delay & repeat-interval