Skip to content

provide analogue of @elapsed #35

@stevengj

Description

@stevengj

A lot of times, I just want the minimum time, especially if I'm collecting or comparing a lot of timing measurements. It would be nice to have an analogue of @elapsed that just returns the minimum time, but with all of the @benchmark niceties.

I've been using:

"""
Like `@benchmark`, but returns only the minimum time in ns.
"""
macro benchtime(args...)
    b = Expr(:macrocall, Symbol("@benchmark"), map(esc, args)...)
    :(time(minimum($b)))
end

Could something like this be included?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions