Out of curiosity, why are you timing an infinite loop?

On Wednesday, September 27, 2017 at 7:39:47 PM UTC-7, Gyuseong jo wrote:
>
> This is server code:
>>
>  
>     def queryResult(self, request, context):
>         count = 0
>         # for index in range(0, 10000000):
>         #     count = count + index
>         while True:
>             count = count + 1
>         return None 
>
> this use cpu 25%
> but this code use cpu 50%
>
>     def queryResult(self, request, context):
>         count = 0
>         # for index in range(0, 10000000):
>         #     count = count + index
>         while True:
>             print(count)
>             count = count + 1
>         return None 
>
> why?
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/26c58f4a-a261-442b-9768-68d71acb6f06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to