Created
September 27, 2021 03:29
-
-
Save Israel-Miles/abe568a0f0e8a8ecacc686ad36cdcc9d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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