public class TestJob {
/**
* @param args
*/
public static void main(String[] args) {
jobTest();
}
public static void jobTest() {
ScheduledExecutorService service = Executors.newScheduledThreadPool(1);
service.scheduleAtFixedRate(new Job(), 0, 2, TimeUnit.SECONDS);
}
}
class Job implements Runnable{
@Override
public void run() {
System.out.println("hello");
}
}
/**
* @param args
*/
public static void main(String[] args) {
jobTest();
}
public static void jobTest() {
ScheduledExecutorService service = Executors.newScheduledThreadPool(1);
service.scheduleAtFixedRate(new Job(), 0, 2, TimeUnit.SECONDS);
}
}
class Job implements Runnable{
@Override
public void run() {
System.out.println("hello");
}
}