color/Benchmarks_test.go

38 lines
542 B
Go

package color_test
import (
"testing"
"git.akyoto.dev/go/color"
)
func BenchmarkRGB(b *testing.B) {
for i := 0; i < b.N; i++ {
color.RGB(1.0, 1.0, 1.0)
}
}
func BenchmarkLCH(b *testing.B) {
for i := 0; i < b.N; i++ {
color.LCH(0.5, 0.5, 0.0)
}
}
func BenchmarkPrint(b *testing.B) {
color.Terminal = true
c := color.RGB(1.0, 1.0, 1.0)
for i := 0; i < b.N; i++ {
c.Print("")
}
}
func BenchmarkPrintRaw(b *testing.B) {
color.Terminal = false
c := color.RGB(1.0, 1.0, 1.0)
for i := 0; i < b.N; i++ {
c.Print("")
}
}