gitee.com/quant1x/num@v0.3.2/vectors/vectors_test.go (about) 1 package vectors 2 3 import ( 4 "fmt" 5 "testing" 6 ) 7 8 func TestRepeat_Base(t *testing.T) { 9 x := make([]float64, 100) 10 Repeat(x, 1.23, len(x)) 11 fmt.Println(x) 12 } 13 14 const ( 15 benchRepeatTimes = 5000 16 ) 17 18 func BenchmarkRepeat(b *testing.B) { 19 x := make([]float64, benchRepeatTimes) 20 for n := 0; n < b.N; n++ { 21 Repeat(x, 1.23, len(x)) 22 } 23 }