Created
May 21, 2013 15:02
-
-
Save ojacobson/5620500 to your computer and use it in GitHub Desktop.
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 characters
package com.example.estobhan; | |
import java.util.Timer; | |
import java.util.TimerTask; | |
public class TimerExample { | |
private static final long PERIOD = 5000; | |
public static void main(String[] args) { | |
final Timer timer = new Timer(); | |
TimerTask periodicMessage = new TimerTask() { | |
@Override | |
public void run() { | |
System.out.println("Tick."); | |
} | |
}; | |
timer.schedule(periodicMessage, PERIOD, PERIOD); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment