示例#1
0
func invoke(c pb.GreeterClient, name string) {
	r, err := c.SayHello(context.Background(), &pb.HelloRequest{Name: name})
	if err != nil {
		log.Fatalf("could not greet: %v", err)
	}
	_ = r
}
示例#2
0
func syncTest(client *greeter.GreeterClient, name string) {
	i := 10000
	t := time.Now().UnixNano()
	for ; i > 0; i-- {
		client.SayHello(name)
	}
	fmt.Println("took", (time.Now().UnixNano()-t)/1000000, "ms")
}