/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package lab8multiplethread; import java.util.*; /** * * @author Peilos */ public class TimeCal { long startTime, currentTime; public void TakeStartTime() { GregorianCalendar gcl = new GregorianCalendar(); gcl.setTime(new Date()); startTime = gcl.getTimeInMillis(); } long getNewTimeDifference() { GregorianCalendar gcl = new GregorianCalendar(); gcl.setTime(new Date()); currentTime = gcl.getTimeInMillis(); return (currentTime - startTime); } @SuppressWarnings("empty-statement") public void RunForSomeTime(long timeInMillis) { this.TakeStartTime(); while(this.getNewTimeDifference()