![]() |
|
[Java] java stopWatch in timeline - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Java] java stopWatch in timeline (/showthread.php?tid=5979082) |
java stopWatch in timeline - deadsh0t - Jun 12, 2019 So im doing and endproject on my first year of aplication developer, we need to make snake and i already finished the snake part however we need to use a stopwatch to keep track of the playtime. I did it like this: Code long s = ((end - start) /1000) % 60;where end is the current system time in millisec and start is set once at the beginning of the game it also takes the current system time in millisec. However the problem is i need to be able to pause the game and the stopwatch also needs to be paused however since its using the current system time when the timeline resumes its like the stopwatch never stopped. I find it a bit hard to think about a logical solution since ive been programming for a few hours straight. please enlighten me 😉 UPDATE: FIGURED IT OUT |