Java Timer Usage exitSystemAfterTimeout(final long delay)

Here you can find the source of exitSystemAfterTimeout(final long delay)

Description

exit System After Timeout

License

Apache License

Declaration

public static void exitSystemAfterTimeout(final long delay) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public static void exitSystemAfterTimeout(final long delay) {
        new Timer().schedule(new TimerTask() {
            @Override/*w ww.  jav a 2 s .  c om*/
            public void run() {
                System.exit(1);
            }
        }, delay);
    }
}

Related

  1. countWorkerPoolTimerThreads()
  2. delayedExit(final int status, final long delay)
  3. getMinIdleTimer()
  4. getQuickSearchTimer()
  5. getSlowTimer()
  6. getTimer(String id)