sleep.java :  » Game » galatichero » org » jpedal » utils » Java Open Source

Java Open Source » Game » galatichero 
galatichero » org » jpedal » utils » sleep.java
/**
* ===========================================
* Storypad
* ===========================================
*
* Project Info:  http://www.idrsolutions.com
* Project Lead:  Mark Stephens (mark@idrsolutions.com)
*
* (C) Copyright 2004, IDRsolutions and Contributors.
*
* ---------------
* sleep.java.java
* ---------------
* (C) Copyright 2002, by IDRsolutions and Contributors.
*
* Original Author:  Mark Stephens (mark@idrsolutions.com)
* Contributor(s):
*
*/
package org.jpedal.utils;

/**
 * provide a delay
 */
public class sleep extends Thread
{
  
  /**
   *The time the program sleeps (in seconds) before repolling incoming dir
   */
  private int delay = 5;
  public void destroy()
  {
    this.destroy();
    this.stop();
  }
  
  /**
   * pass through value of sleep in seconds
   */
  public sleep( int delay ) 
  {
    this.delay = delay;
    try
    {
      yield();
      sleep( delay);
    }
    catch( Exception e )
    {e.printStackTrace();}
  }
  
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.