pow_test增加计时

This commit is contained in:
tsosunchia
2023-06-02 13:49:15 +08:00
parent 2493f471dc
commit b1cabbc6d4
2 changed files with 8 additions and 2 deletions

View File

@@ -4,10 +4,16 @@ import (
"fmt"
"github.com/stretchr/testify/assert"
"testing"
"time"
)
func TestGetToken(t *testing.T) {
// 计时开始
start := time.Now()
token, err := GetToken("103.120.18.35", "api.leo.moe", "443")
fmt.Println(token, err)
// 计时结束
end := time.Now()
fmt.Println("耗时:", end.Sub(start))
fmt.Println("token:", token)
assert.NoError(t, err, "GetToken() returned an error")
}

View File

@@ -8,6 +8,6 @@ import (
func TestDNS(t *testing.T) {
resolver := DNSSB()
ips, _ := resolver.LookupHost(context.Background(), "www.google.com")
ips, _ := resolver.LookupHost(context.Background(), "www.bing.com")
fmt.Println(ips)
}