Created
May 19, 2025 06:57
-
-
Save antonkalik/f3fb391c6fe34ca9cd55d43c9427f7b6 to your computer and use it in GitHub Desktop.
float
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() | |
var sum float64 = 0 | |
for i := 0; i < 1_000_000_000; i++ { | |
sum += float64(i) | |
} | |
duration := time.Since(start) | |
fmt.Println("Go Loop Benchmark (float64):", duration) | |
fmt.Println("Sum:", sum) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment