github.com/nxtrace/NTrace-core@v1.3.1-0.20240513132635-39169291e8c9/pow/pow_test.go (about) 1 package pow 2 3 import ( 4 "fmt" 5 "github.com/stretchr/testify/assert" 6 "testing" 7 "time" 8 ) 9 10 func TestGetToken(t *testing.T) { 11 // 计时开始 12 start := time.Now() 13 token, err := GetToken("origin-fallback.nxtrace.org", "origin-fallback.nxtrace.org", "443") 14 // 计时结束 15 end := time.Now() 16 fmt.Println("耗时:", end.Sub(start)) 17 fmt.Println("token:", token) 18 assert.NoError(t, err, "GetToken() returned an error") 19 }