‘’‘julia
using BenchmarkTools @benchmark sort(data) setup=(data=rand(10))
‘’’
When I ran these code in Vs-code, errors as below:
BenchmarkTools.Trial: 10000 samples with 1000 evaluations.
ERROR: MethodError: no method matching median(::Vector{Float64})
Closest candidates are:
median(::AbstractVector{T} where T<:Real, ::AbstractWeights)
@ StatsBase C:\Users\zzzz.julia\packages\StatsBase\XgjIN\src\weights.jl:782
median(::BenchmarkTools.Trial)
@ BenchmarkTools C:\Users\zzzz.julia\packages\BenchmarkTools\QAv7m\src\trials.jl:129
median(::Distributions.Kolmogorov)
@ Distributions C:\Users\zzzz.julia\packages\Distributions\km0AH\src\univariate\continuous\kolmogorov.jl:27
…
Is there any issue in my BenchmarkTools package? Its version is 1.4.0
Try restarting the REPL (either click the bin icon on your REPL and start a new one, or you can use the restart repl command (ctrl-shift-p then searching restart repl might work)). Then run those two lines.
If it still doesn’t work please provide the complete error.