Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timing() time.Duration support #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Timing() time.Duration support #25

wants to merge 1 commit into from

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