You need to try debugging the code to see what it is doing. Add a println statement inside the while loop that prints out the values of currentTime and endTime just before the if statement so you can see what their values are as the code executes.
I suggest you remove the *60000 and just use the value entered for the duration to make the numbers more reasonable.
Also I recommend that you replace the while(true) loop with a for loop that goes for 100 loops.
That will be enough times that the print out will show you what the problem is.
Another suggestion: Don't use an == test for the end time,
better to use >=
BTW This is the absolute worst way to have a program wait.
The Thread class's sleep() method is one better way. Later you find some other better ways.
I'm Done for tonight. Back tomorrow.