@@ -0,0 +1,611 @@
+package de.asw.java.training2016.basics;%0A%0Aimport java.util.concurrent.TimeUnit;%0A%0Apublic class ThreadSleepExamples %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%0A%09%09System.out.println(%22Warte!%22);%0A%0A%09%09try %7B%0A%09%09%09// Alternative 1 (Sprechende API)%0A%09%09%09TimeUnit.SECONDS.sleep(2);%0A%09%09%7D catch (InterruptedException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%0A%09%09// Alternative 2: (Java Standard)%0A%09%09// try %7B%0A%09%09// Thread.sleep(2000);%0A%09%09// %7D catch (InterruptedException e) %7B%0A%09%09// e.printStackTrace();%0A%09%09// %7D%0A%0A%09%09// Alternative 3 (Advanced Java)%0A%09%09// LockSupport.parkNanos(TimeUnit.SECONDS.toNanos(2));%0A%0A%09%09System.out.println(%22Fertig!%22);%0A%09%7D%0A%7D%0A

Add example for letting a Thread sleep for some time