home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
kaffe-0.5p4-src.tgz
/
tar.out
/
contrib
/
kaffe
/
test
/
threads
/
sleepers.java
< prev
next >
Wrap
Text File
|
1996-09-28
|
426b
|
27 lines
public class sleepers implements Runnable
{
int time;
public static void main(String args[])
{
sleepers s = new sleepers();
Thread t1 = new Thread(s, "1");
Thread t2 = new Thread(s, "2");
t1.start();
t2.start();
}
public void run()
{
for (;;) {
System.out.println(Thread.currentThread().getName());
try {
time += 1000;
Thread.sleep(time);
}
catch (Exception e) {
}
}
}
}