Intermediate Julia
Anthony Markham
Quantitative Developer
function my_function()
x = Vector{Char}()
for i in "Anthony"
push!(x, i)
end
println(x)
end
['A', 'n', 't', 'h', 'o', 'n', 'y']
Advantages:
Disadvantages:
@time my_function()
@time my_function()
0.278266 seconds (110.66 k allocations: 6.343 MiB, 99.79% compilation time)
0.000493 seconds (100 allocations: 3.281 KiB)
Why use @benchmark
over @time
?
samples
.@benchmark my_function
Intermediate Julia