Skip to content

Conversation

@ookura-mf
Copy link

No description provided.

isLast := num == len(nums)

go func(n int, isLast bool) {
if isLast {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

メモ:最後に完了するgoroutineをどうやって判別するのかわからなかったので、もう一度考える

func main() {
fmt.Println("+++++ Metronome is start +++++")

bpm := 120
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

標準入力から受け取れるようにする

defer ticker.Stop()

go func() {
time.Sleep(5 * time.Second)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

標準入力から止めれるようにしてみたい

select {
case <-ticker.C:
if flag == 0 {
fmt.Println("tic")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beepとかならせるかな・・?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant