I have a 10 and 20 question game. I need to count how much time is passed when a user finishes the game.
Timer T=new Timer(); T.scheduleAtFixedRate(new Timer
When the game starts:
long tStart = System.currentTimeMillis();
When the game ends:
long tEnd = System.currentTimeMillis(); long tDelta = tEnd - tStart; double elapsedSeconds = tDelta / 1000.0;