Skip to content

Instantly share code, notes, and snippets.

@antonkalik
Created May 19, 2025 06:57
Show Gist options
  • Save antonkalik/f3fb391c6fe34ca9cd55d43c9427f7b6 to your computer and use it in GitHub Desktop.
Save antonkalik/f3fb391c6fe34ca9cd55d43c9427f7b6 to your computer and use it in GitHub Desktop.
float
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