zzzming commented on code in PR #769:
URL: https://github.com/apache/pulsar-client-go/pull/769#discussion_r861272911


##########
pulsar/consumer_impl.go:
##########
@@ -423,6 +423,11 @@ func (c *consumer) Unsubscribe() error {
 }
 
 func (c *consumer) Receive(ctx context.Context) (message Message, err error) {
+       start := time.Now()
+       defer func() {
+               now := time.Now().UnixNano()
+               c.metrics.RecvTime.Observe(float64(now-start.UnixNano()) / 
1.0e9)

Review Comment:
   Golang has a more standard way to calculate since time in seconds or any 
time unit. Here is an example.
   
   time.Since(startTime).Seconds()



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to