Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A Metronome example, developed in Golang. Takes a bpm and count as input.
package main
import (
func main() {
bpm, err := strconv.Atoi(os.Args[1])
count, err2 := strconv.Atoi(os.Args[2])
if err != nil || err2 != nil {
times := time.Duration(bpm)
for index := 0; index < count; index++ {
time.Sleep(time.Minute / times)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.