Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    public static void sleepForever() {
        sleep(Long.MAX_VALUE);
    }

    /**
     * Sleep and wake on InterruptedException
     * @param timeToSleep in milliseconds
     */
    public static void sleep(long timeToSleep) {
        if (timeToSleep <= 0)
            return;
        try {
            Thread.sleep(timeToSleep);
        } catch (InterruptedException e) {
        }
    }
}