package de.galan.commons.time;

/**
 * Encapsulates the InterruptedException from Thread.sleep(ms).
 * 
 * @author daniel
 */
public class Sleeper {

	/**
	 * Sleep a given time (time is parsed with HumanTime)
	 * 
	 * @param humanTime The time in a format such as 30m10s10ms
	 */
	public static void sleep(String humanTime) {
		sleep(HumanTime.dehumanizeTime(humanTime));
	}


	/**
	 * Sleep the given milliseconds, swallowing the exception
	 * 
	 * @param millis time in milliseconds
	 */
	public static void sleep(long millis) {
		try {
			Thread.sleep(millis);
		}
		catch (InterruptedException ex) {
			// nada
		}
	}

}

@@ -95,18 +95,17 @@
 (ms).%0A *
- 
 %0A
+
  * @auth
@@ -201,25 +201,24 @@
 manTime)%0A%09 *
- 
 %0A%09 * @param 
@@ -436,17 +436,16 @@
 tion%0A%09 *
- 
 %0A%09 * @pa
@@ -602,15 +602,43 @@
 %0A%09%09%09
-// nada
+Thread.currentThread().interrupt();
 %0A%09%09%7D

reset interrupted flag