I have a custom function and I would like to evaluate its media performance. For this, I would like to loop by executing my function a certain number of times. I want to do this because I see that the runtime is very unstable.

A typical execution measuring the execution time would look something like this

```
@time my_function()

```

or

```
@time begin
my_function()
end

```

In this particular case, I only visualize the execution time, but I don't know how to register the execution time to allocate the time for each iteration in a vector. For example, I would like something like this

```
vector_time = 1:100
for i in 1:100
    @time my_function()
    vector_time[i] = get_time_i # register the time of the i-th iteration 
end

```
['https://Stackoverflow.com/questions/66880148', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/12005038/']
Try [`@elapsed`](https://docs.julialang.org/en/v1/base/base/#Base.@elapsed) instead to get the execution time in seconds.
If you are timing multiple sections of your code at once, you can also use [TimerOutputs.jl](https://github.com/KristofferC/TimerOutputs.jl), which I've found to be very convenient. It automatically computes average runtimes and % total runtime.