Accurately Calculating the time a Thread takes to run
How do I accurately gain timings for a thread? I have a number of threads which are calling CalculatorEngine which locks on an object starts a timer (ctime = System.currentTimeMillis();) and then logs the time just before the thread exits
System.out.println("Calculations for " + setName + " for " + calcsMadeByCalcEnginge + " positions took: " + (System.currentTimeMillis() - ctime));
But if there is a context swich my timer will continue to run until the thread is reactivated and then completes... How can I gain the actual timings for how long the thread took?

