hey i have this function in my code:
public synchronized void finished()
{
howManyDone++;
log.append("Finished creating board "+this.howManyDone+"\n");
if(howManyDone == boards.length)
JOptionPane.showMessageDialog(log, "All Boards Were Created.","Attention",JOptionPane.WARNING_MESSAGE);
}
i want to add to the log.append command how much evrey thread ran in sec. i tried to do this one:
public synchronized void finished()
{
long start = System.nanoTime();
howManyDone++;
long end = System.nanoTime();
long estTime = end - start;
double seconds = (double)estTime/1000000000;
}
and than print the seconds in each time like this:
log.append("Finished creating board " +this.howManyDone+ " in "+seconds+"\n");
but the numbers i get in the log as the seconds appears like that: 6.00E-7 and so on... what am i doing wrong?
thanks