I have a class that spawns threads to process data. I am working on instrumentation code. When the process is started, time = System.currentTimeMillis(); When it completes, time = System.currentTimeMillis() - time; I have a method to retrieve this time:
/**
* Get the time taken for process to complete
*
* @return Time this process has run if running; time it took to complete if not
*/
public long getRunTime() {
return processRunning? System.currentTimeMillis() - time : time;
}
Is this a clear use of the ternary operator? Is my javadoc comment clear?