thread sleep java
package com.journaldev.threads;
public class ThreadSleep {
public static void main(String[] args) throws InterruptedException {
long start = System.currentTimeMillis();
Thread.sleep(2000);
System.out.println("Sleep time in ms = "+(System.currentTimeMillis()-start));
}
}
import java.util.concurrent.TimeUnit
TimeUnit.SECONDS.sleep(1);
or
TimeUnit.MINUTES.sleep(1);Thread.sleep(2000);
Also in Java:
- java 8 seconds to days
- spigot kill entity
- processing sound library
- jsonobject to java object
- loop and save letters in a string java
- how to break two loop in java
- how to remove components from a JFRame java
- jquery set data attribute value
- remove last character from string java
- java unit test an api
- how to scan a character in java
- get first 5 characters of string java
- java
- how to play an audio in java
- continue in java
- how to do for each in java
- difference between compile and execute in java
- fibonacci sequence in java recursion
- bukkit java get max players
- double parse jtextfield
- how to have a only number type in java
- butterfly pattern program in java
- write an infinite loop java
- déclarer un tableau en java