Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Main Class
- import java.util.Timer;
- import java.util.TimerTask;
- public class Java{
- public static int count = 0;
- public static void main(String args[]){
- Timer timer = new Timer();
- //Timer will fire every second
- timer.schedule(new TimerTask(){
- @Override
- public void run(){
- count++;
- System.out.println("Scheduled timer " + count);
- }
- }, 1000, 1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement