Skip to content

Instantly share code, notes, and snippets.

@Mayankgupta688
Created October 14, 2019 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mayankgupta688/f94f92907a601d9c44da10bef08d421b to your computer and use it in GitHub Desktop.
Save Mayankgupta688/f94f92907a601d9c44da10bef08d421b to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"time"
"runtime"
)
func main() {
runtime.GOMAXPROCS(4)
start := time.Now()
go func() {
for i:=0; i < 3; i++ {
fmt.Println(i)
}
}()
go func() {
for i:=0; i < 3; i++ {
fmt.Println(i)
}
}()
elapsedTime := time.Since(start)
fmt.Println("Total Time For Execution: " + elapsedTime.String())
time.Sleep(time.Second)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment