Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Kwisses
Last active February 26, 2017 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kwisses/0f976991913fb6f86ea3f954eb30d1a5 to your computer and use it in GitHub Desktop.
Save Kwisses/0f976991913fb6f86ea3f954eb30d1a5 to your computer and use it in GitHub Desktop.
[XtraJava] - VisualMetronome
// 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