Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Timer;
import java.util.TimerTask;

public class Main {
    public static void startThreadStatusTimer(final Thread t1) {
        new Timer().schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("\t\t\t\t\t\t\t\t\t\tThread(" + t1.getName() + ") state - " + t1.getState());
            }
        }, 0, 1000);
    }

    public static void startThreadStatusTimer(final Thread t1, int ms) {
        new Timer().schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("\t\t\t\t\t\t\t\t\t\tThread(" + t1.getName() + ") state - " + t1.getState());
            }
        }, 0, ms);
    }
}