Files
Charon/backend/internal/services/benchmark_test.go
2026-03-04 18:34:49 +00:00

23 lines
355 B
Go

package services
import (
"testing"
"time"
)
func BenchmarkFormatDuration(b *testing.B) {
d := 3665 * time.Second
b.ResetTimer()
for i := 0; i < b.N; i++ {
formatDuration(d)
}
}
func BenchmarkExtractPort(b *testing.B) {
url := "https://discord.com/api/webhooks/123/abc:8080"
b.ResetTimer()
for i := 0; i < b.N; i++ {
extractPort(url)
}
}