Skip to content

Conversation

@llecigne
Copy link

@llecigne llecigne commented Jun 5, 2017

Sometimes Timing struct cannot be used because duration to record is known using a starting date coming from another context (DB or whatever).

When using Client.Timing method, caller has to manually redo the int64 casting/millisecond truncating by hand because time.Duration is not supported.

ex:

startDate := ... // some time.Time coming from another context
client.Timing(int64(time.Now().Sub(startDate)/time.Millisecond))

a simpler alternative would be

client.Timing(time.Now().Sub(startDate))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant