List of usage examples for java.lang Thread sleep
public static native void sleep(long millis) throws InterruptedException;
From source file:Main.java
public static void main(String[] args) { new Thread(uncheck(() -> { Thread.sleep(1000L); System.out.println("done"); })).start();/* w w w . j a v a2 s. co m*/ }
From source file:Main.java
public static void main(String[] argv) throws Exception { long numMillisecondsToSleep = 5000; Thread.sleep(numMillisecondsToSleep); }
From source file:Main.java
public static void main(String[] argv) throws Exception { long numMillisecondsToSleep = 5000; // 5 seconds Thread.sleep(numMillisecondsToSleep); }
From source file:Main.java
public static void main(String[] argv) throws Exception { long start = System.currentTimeMillis(); Thread.sleep(2000); long elapsedTimeMillis = System.currentTimeMillis() - start; System.out.println(elapsedTimeMillis); }
From source file:Main.java
public static void main(String[] argv) throws Exception { long start = System.currentTimeMillis(); Thread.sleep(2000); // // ww w.j a va 2 s.c o m long elapsedTimeMillis = System.currentTimeMillis() - start; System.out.println(elapsedTimeMillis); }
From source file:Main.java
public static void main(String[] argv) throws Exception { long start = System.currentTimeMillis(); Thread.sleep(2000); // Get elapsed time in milliseconds long elapsedTimeMillis = System.currentTimeMillis() - start; float elapsedTimeDay = elapsedTimeMillis / (24 * 60 * 60 * 1000F); System.out.println(elapsedTimeDay); }
From source file:Main.java
public static void main(String[] argv) throws Exception { long start = System.currentTimeMillis(); Thread.sleep(2000); // Get elapsed time in milliseconds long elapsedTimeMillis = System.currentTimeMillis() - start; // Get elapsed time in hours float elapsedTimeHour = elapsedTimeMillis / (60 * 60 * 1000F); System.out.println(elapsedTimeHour); }
From source file:Main.java
public static void main(String[] argv) throws Exception { long start = System.currentTimeMillis(); Thread.sleep(2000); // Get elapsed time in milliseconds long elapsedTimeMillis = System.currentTimeMillis() - start; float elapsedTimeSec = elapsedTimeMillis / 1000F; System.out.println(elapsedTimeSec); }
From source file:Main.java
public static void main(String[] argv) throws Exception { long start = System.currentTimeMillis(); Thread.sleep(2000); // Get elapsed time in milliseconds long elapsedTimeMillis = System.currentTimeMillis() - start; // /*w w w . ja v a2 s .co m*/ float elapsedTimeSec = elapsedTimeMillis / 1000F; System.out.println(elapsedTimeSec); }
From source file:Main.java
public static void main(String[] argv) throws Exception { long start = System.currentTimeMillis(); Thread.sleep(2000); // Get elapsed time in milliseconds long elapsedTimeMillis = System.currentTimeMillis() - start; // Get elapsed time in minutes float elapsedTimeMin = elapsedTimeMillis / (60 * 1000F); System.out.println(elapsedTimeMin); }