Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "time"
- )
- func main() {
- go task(20000)
- go task(10000)
- time.Sleep(time.Second * 5)
- fmt.Println("End")
- }
- func task(count int64) {
- start := time.Now()
- for i := count; i > 0; i-- {
- for j := count; j > 0; j-- {
- }
- }
- end := time.Now()
- fmt.Printf("Count %d; %d.%d - %d.%d\n", count, start.Second(), start.Nanosecond(), end.Second(), end.Nanosecond())
- }
Advertisement
Add Comment
Please, Sign In to add comment