Java Thread Pause pause(int i, String unit)

Here you can find the source of pause(int i, String unit)

Description

pause

License

Open Source License

Declaration

public static void pause(int i, String unit) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static void pause(int i, String unit) {
        try {/*from www.ja  v  a  2 s.co  m*/
            switch (unit) {
            case "ms":
                Thread.sleep(i);
                break;
            case "s":
                Thread.sleep(i * 1000);
                break;
            case "m":
                Thread.sleep(i * 60000);
                break;
            default:
                break;
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}

Related

  1. pause()
  2. pause(double seconds)
  3. pause(double seconds)
  4. pause(double timeInSec)
  5. pause(final long time)
  6. pause(int millis)
  7. pause(int millis)
  8. pause(int milliseconds)
  9. pause(int ms)