ukcrobots.util
Class Sleeper

java.lang.Object
  |
  +--ukcrobots.util.Sleeper

public class Sleeper
extends Object

A utility class to provide both static and non-static sleep methods without having to worry about an InterruptedException.

Version:
2003.03.21
Author:
David J. Barnes (d.j.barnes @at@ kent.ac.uk)

Constructor Summary
Sleeper()
          Create a Sleeper.
 
Method Summary
 void letTimePass(long time)
          Sleep for a non-guaranteed time up to time milliseconds.
static void sleep(long time)
          Sleep for a non-guaranteed time up to time milliseconds.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Constructor Detail

Sleeper

public Sleeper()
Create a Sleeper.

Method Detail

sleep

public static void sleep(long time)
Sleep for a non-guaranteed time up to time milliseconds. This method is an exception-catching wrapper around java.lang.Thread.sleep to avoid having to write the exception handler.

Parameters:
time - The maximum time to sleep

letTimePass

public void letTimePass(long time)
Sleep for a non-guaranteed time up to time milliseconds.

Parameters:
time - The maximum time to sleep