Created
March 12, 2018 17:33
-
-
Save Cj1m/1693b59284594902998daa09c82b2699 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void runTimer(){ | |
if(snake.isAlive()){ | |
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); | |
executor.schedule(runTimer(), 1, TimeUnit.SECONDS); | |
executor.shutdown(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment