Source:
http://www.danchisholm.net/oct1/topic/section7/threads2.html What is the significance of System.currentTimeMillis();???
Also, why a synchronised block is used???
class A extends
Thread {
public void run() {
synchronized (this) {
try {wait(5000);} catch (InterruptedException ie){}
}}
public static void main(
String[] args) {
A a1 = new A();
long startTime = System.currentTimeMillis();
a1.start();
System.out.print(System.currentTimeMillis() - startTime + ",");
try {a1.join(6000);} catch (InterruptedException ie) {}
System.out.print(System.currentTimeMillis() - startTime);
}}