You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
607 B

package sig
import (
"fmt"
"sig-pub/api/pb"
"sig-pub/pkg/types"
"sig-pub/pkg/utils/times"
"testing"
)
func TestKlineSeries(t *testing.T) {
ks := NewKlineSeries(pb.ExchangeType_SIG, "TEST_USDT", types.Interval5m)
intervalAdder := types.SupportedIntervals[types.Interval5m]
KlineBefore0 := int64(1672502400000)
w := times.NewWatch()
for i := range int64(128000) {
k := &types.Kline{
Ts: intervalAdder(KlineBefore0, i),
}
ks.Update(k)
}
fmt.Println(w.ElapsedFmt("."))
w.Reset()
for range 100000 {
a := ks.MustSeries(0, 12) // 500(op/ms)
_ = a
}
fmt.Println(w.ElapsedFmt("."))
}