sleep() implementation

I just became the proud daddy of a beautiful baby girl. As all IT guys, I usually don't start with the manual when I get my hands on something new: exploring is the best way to learn something ;-) This time, though, I decided to do it by the book and read the JavaDoc first. The description of the sleep() method worries me a bit.... I wonder if there is a plugpoint when I can squeeze in a more reliable implementation of the sleep() method.


Interface BabyGirl


public interface BabyGirl


Method Summary
 void sleep(long millis)
          Calling the sleep(long millisec) method suggests that the BabyGirl goes to sleep for the specified number of milliseconds.
 

Method Detail

sleep

public void sleep(long millis)
           throws java.lang.InterruptedException,
                  java.lang.UnsupportedOperationException
Calling the sleep(long millisec) method suggests that the BabyGirl goes to sleep for the specified number of milliseconds. It's up to the implementation to decide if it will actually do so.

Parameters:
millis - the length of time to sleep in milliseconds.
Throws:
java.lang.InterruptedException - if the sleep is disrupted by anything.
java.lang.UnsupportedOperationException - if the implementation does not allow others to decide when sleeping is appropriate.

2 comments:

  1. Gero said...

    The real question is of course how you can have one instance sleeping while the other one is not sleeping. Sleep concurrently, if you see what I mean.
    Note: Comment imported. Original by Wilfred ( ) at 2005-09-26 20:46  

  2. Gero said...

    perhaps forcing the garbage collector to run on the diaper would improve the performance?
    Note: Comment imported. Original by arno at 2005-10-04 10:45  

Post a Comment