Skip to content

Instantly share code, notes, and snippets.

@goFrendiAsgard
Last active August 29, 2015 14:00
Show Gist options
  • Save goFrendiAsgard/24be9be6e0be8be7658e to your computer and use it in GitHub Desktop.
Save goFrendiAsgard/24be9be6e0be8be7658e to your computer and use it in GitHub Desktop.
Try concurrency
package main
import (
"fmt"
"time"
)
func write(n int){
for i := 0; i<100; i++ {
time.Sleep(100 * time.Millisecond)
if i%n == 0{
fmt.Println(i, " bisa dibagi " ,n)
}
}
}
func main() {
go write(2)
go write(3)
go write(5)
write(7)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment