I have written a very short and simple Go program. All it does is output 0-999999. I am very confused because the output is MUCH faster in the Console for GoLand IDE as opposed to the Windows 10 CMD. I have also tested with PowerShell and Git Bash. Both are also A LOT slower than GoLand IDE.
I'll post the code below as well as time taken from the code ran in CMD and GoLand IDE Console. Thank you.
package main
import (
"fmt"
"time"
)
func main() {
start := time.Now()
for i := 0; i < 1000000; i++ {
fmt.Println(i)
}
elapsed := time.Since(start)
fmt.Println("Time took:", elapsed)
}
GoLand IDE Console: Time took: 2.1853708s
Windows 10 CMD: Time took: 37.3894414s