Skip to content

Instantly share code, notes, and snippets.

@Israel-Miles
Created September 27, 2021 03:29
Show Gist options
  • Save Israel-Miles/abe568a0f0e8a8ecacc686ad36cdcc9d to your computer and use it in GitHub Desktop.
Save Israel-Miles/abe568a0f0e8a8ecacc686ad36cdcc9d to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"time"
)
func main() {
start := time.Now()
for i := 1; i <= 10; i++ {
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