Last active
February 26, 2017 05:41
-
-
Save Kwisses/0f976991913fb6f86ea3f954eb30d1a5 to your computer and use it in GitHub Desktop.
[XtraJava] - VisualMetronome
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
// Display count numbers in console. | |
class VisualMetronome { | |
public static void main(String args[]) { | |
int count, start, limit, bpm, ms; | |
start = 1; | |
count = start; | |
limit = 4; | |
bpm = 120; | |
ms = 60_000 / bpm; | |
while(count <= limit) { | |
System.out.println(count); | |
count ++; | |
if(count > limit) count = start; | |
try { | |
Thread.sleep(ms); | |
} catch (InterruptedException e) { | |
e.printStackTrace(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment