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

Return named tuple from @timed #34147

Closed
jw3126 opened this issue Dec 19, 2019 · 1 comment · Fixed by #34149
Closed

Return named tuple from @timed #34147

jw3126 opened this issue Dec 19, 2019 · 1 comment · Fixed by #34149
Labels
good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request

Comments

@jw3126
Copy link
Contributor

jw3126 commented Dec 19, 2019

Can we return a named tuple from @timed macro?

julia> value, time, bytes, gctime, gcdiff = @timed rand(10^6);

is error prone and hard to remember.

@StefanKarpinski
Copy link
Member

Good idea. Should be non-breaking since named tuples iterate their values in order:

julia> value, time, bytes, gctime, gcdiff = (value = 1.234, time = 0.008384599, bytes = 8020768, gctime = 0.0, gcdiff = Base.GC_Diff(8020768, 1, 0, 19, 3, 0, 0, 0, 0))
(1.234, 0.008384599, 8020768, 0.0, Base.GC_Diff(8020768, 1, 0, 19, 3, 0, 0, 0, 0))

@StefanKarpinski StefanKarpinski added good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request labels Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants