+ 1
How to set a timer for quiz in java?
It should be run when the user start the quiz after fill the information and it should be stop when the user finish. Do you have any idea?
4 Respostas
+ 2
System.currentTimeMillis() --> the difference between the current time and midnight, January 1, 1970 UTC, in milliseconds.
long start = System.currentTimeMillis();
//your quiz
long end = System.currentTimeMillis();
long time = end - start;
If you get 0 use System.nanoTime()
long start = System.nanoTime();
//your quiz
long end = System.nanoTime();
long time = end - start;
+ 3
https://code.sololearn.com/c0EphMK2NCt8/?ref=app
+ 3
Google it