title: How to measure execution time of each loop step in Julia?
body: <p>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.</p>
  <p>A typical execution measuring the execution time would look something like this</p>
  <pre><code>@time my_function()
  </code></pre>
  <p>or</p>
  <pre><code>@time begin
  my_function()
  end
  </code></pre>
  <p>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</p>
  <pre><code>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
  
  </code></pre>