@ -63,10 +63,20 @@ public abstract class Race implements Runnable {
long timeLoopStarted ;
long timeLoopStarted ;
long timeLoopEnded ;
long timeLoopEnded ;
long minutes ;
long currentTimeInSeconds ;
long remainingSeconds ;
while ( finishingBoats . size ( ) < startingBoats . length ) {
while ( finishingBoats . size ( ) < startingBoats . length ) {
timeLoopStarted = System . currentTimeMillis ( ) ;
timeLoopStarted = System . currentTimeMillis ( ) ;
totalTimeElapsed = System . currentTimeMillis ( ) - timeRaceStarted ;
totalTimeElapsed = System . currentTimeMillis ( ) - timeRaceStarted ;
long currentTime = System . currentTimeMillis ( ) - timeRaceStarted ;
currentTimeInSeconds = currentTime / 1000 ;
minutes = currentTimeInSeconds / 60 ;
remainingSeconds = currentTimeInSeconds % 60 ;
System . out . println ( minutes + ":" + remainingSeconds ) ;
for ( BoatInRace boat : startingBoats ) {
for ( BoatInRace boat : startingBoats ) {
updatePosition ( boat , SLEEP_TIME ) ;
updatePosition ( boat , SLEEP_TIME ) ;
checkPosition ( boat , totalTimeElapsed ) ;
checkPosition ( boat , totalTimeElapsed ) ;