Skip to content

Instantly share code, notes, and snippets.

@Israel-Miles
Last active September 27, 2021 13:22
Show Gist options
  • Save Israel-Miles/29eadbe6bad3c26f642e213c756ae7e1 to your computer and use it in GitHub Desktop.
Save Israel-Miles/29eadbe6bad3c26f642e213c756ae7e1 to your computer and use it in GitHub Desktop.
func main() {
start := time.Now()
for i := 1; i <= 10; i++ {
go executeTask(i)
}
fmt.Println("Total execution time:", time.Since(start))
}
func executeTask(i int) {
fmt.Println("Executing task", i)
time.Sleep(250 * time.Millisecond)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment