Please help me create a better stopwatch | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Please help me create a better stopwatch

Using simple Java code, I have created an unstoppable stopwatch which starts on pressing any key and it displays the time like 1 ... 2 ... 3 ... and so on. Next I created a stoppable stopwatch which starts as well as ends on pressing a key by user's choice and it shows the duration of time passed. But I'm being unable to merge these two codes to create a successful stopwatch which both shows the time and is stoppable. https://code.sololearn.com/cS4iw3wSpkkM/?ref=app https://code.sololearn.com/cS4iw3wSpkkM/?ref=app

27th Sep 2023, 8:21 PM
Mrittika Kundu
Mrittika Kundu - avatar
2 Answers
+ 4
Oh, I see... Yes I know html, not that nice though but I will certainly give it a try. Thank you.
28th Sep 2023, 3:02 AM
Mrittika Kundu
Mrittika Kundu - avatar
+ 2
I might be wrong, but if Java is like Python and is compiled top-down, this probably isn't going to work in Sololearn. Sololearn doesn't show live updates to the console. It first takes any input all at once, then compiles and runs the code and then displays it in the Sololearn "console". I know it's not the same, but if you know html/css/Javascript, you could do this as a web project?
28th Sep 2023, 1:57 AM
Aaron Lee
Aaron Lee - avatar