mirror of
https://github.com/nxtrace/NTrace-core.git
synced 2025-08-12 06:26:39 +00:00
pow_test增加计时
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user