Spawning threads to process data 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?
I have no problem the ternary operator.

But it is hard to tell that the result is what the comments is saying. Without having a context on what time is (which is a bad variable name) it is hard to understand the result of the function.

time: Bad variable name. Time of what?