001         package com.croftsoft.core.lang;
002    
003         /*********************************************************************
004         * A collection of static methods to manipulate Thread objects.
005         *
006         * @version
007         *   1999-10-02
008         * @author
009         *   <a href="https://www.croftsoft.com/">David Wallace Croft</a>
010         *********************************************************************/
011    
012         public class  ThreadLib
013         //////////////////////////////////////////////////////////////////////
014         //////////////////////////////////////////////////////////////////////
015         {
016    
017         /*********************************************************************
018         * Puts the current Thread to sleep for a number of milliseconds.
019         *
020         * @return
021         *   Returns false if InterruptedException was thrown.
022         *********************************************************************/
023         public static boolean  sleep ( long  millis )
024         //////////////////////////////////////////////////////////////////////
025         {
026           try
027           {
028             Thread.currentThread ( ).sleep ( millis );
029           }
030           catch ( InterruptedException  ex )
031           {
032             return false;
033           }
034    
035           return true;
036         }
037    
038         //////////////////////////////////////////////////////////////////////
039         //////////////////////////////////////////////////////////////////////
040         }