Class: |
DimTimer |
Library: |
DIM |
|
Author: |
C. Gaspar |
|
Version: |
v1.0 |
Update :Thu Feb 11 15:52:46
1999 |
Descrition :
Utility Class - Implements Asynchronous TimeOut
Handling
Constructors :
-
DimTimer ( int time ) ; Start the Timer - parameter
time is number of seconds
-
DimTimer ( ) ;
Public Functions :
-
void start ( int time ) ; Start the Timer -
parameter time is number of seconds
-
void stop ( ) ; Stop the timer
-
void timerHandler ( ); the handler
-
static void sleep ( int seconds ); An utility
to put the current thread to sleep for the specified amount of seconds.
Usage :
Example of the timer usage:
public static void start_timer(int secs)
{
DimTimer atimer = new DimTimer(secs)
{
public void timerHandler()
{
System.out.println("tick");
start_timer(secs);
}
};
}
Example of the sleep() method:
public static void main(String[] args)
{
int i = 0;
DimService sid = new DimService("TEST_IT_INT",i);
DimServer.start("TestJDim");
while(true)
{
DimTimer.sleep(10);
sid.updateService(++i);
}
}
Last update : 02/19/99 12:49:03 by MkHelp
1.1.0