Skip to content

BenchmarkTools punning Base.time? #165

@garborg

Description

@garborg

It seems like BenchmarkTools is unique in punning Base.time to mean something other than seconds since epoch.

julia> m
BenchmarkTools.TrialEstimate: 
  time:             4.810 ms
  gctime:           0.000 ns (0.00%)
  memory:           1.66 MiB
  allocs:           68937

julia> time(m)
4.809736e6

help?> time
search: time Timer time_ns timedwait mtime ctime @time @timev @timed gctime @btime f_times f_subtimes istextmime trim selectdim permutedims permutedims! StridedMatrix

  time(t::TmStruct)

  Converts a TmStruct struct to a number of seconds since the epoch.

  ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

  time()

  Get the system time in seconds since the epoch, with fairly high (typically, microsecond) resolution.

julia> methods(time)
# 7 methods for generic function "time":
[1] time(t::BenchmarkTools.Trial) in BenchmarkTools at /home/sean/.julia/packages/BenchmarkTools/eCEpo/src/trials.jl:53
[2] time(t::BenchmarkTools.TrialEstimate) in BenchmarkTools at /home/sean/.julia/packages/BenchmarkTools/eCEpo/src/trials.jl:126
[3] time(t::BenchmarkTools.TrialRatio) in BenchmarkTools at /home/sean/.julia/packages/BenchmarkTools/eCEpo/src/trials.jl:154
[4] time(t::BenchmarkTools.TrialJudgement) in BenchmarkTools at /home/sean/.julia/packages/BenchmarkTools/eCEpo/src/trials.jl:201
[5] time(group::BenchmarkGroup) in BenchmarkTools at /home/sean/.julia/packages/BenchmarkTools/eCEpo/src/groups.jl:73
[6] time() in Base.Libc at libc.jl:247
[7] time(tm::Base.Libc.TmStruct) in Base.Libc at libc.jl:240

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