# Plot using @timed

**URL:** <https://discourse.julialang.org/t/plot-using-timed/37714>\
**Category:** General Usage\
**Tags:** question\
**Created:** [April 16, 2020, 8:56pm UTC](https://discourse.julialang.org/t/plot-using-timed/37714 "2020-04-16T20:56:06Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Post date:** [April 16, 2020, 9:58pm UTC](https://discourse.julialang.org/t/plot-using-timed/37714/2 "2020-04-16T21:58:00Z")

</div>

Didn’t you ask that already here? [How to access the data in @timed and plot directly](https://discourse.julialang.org/t/how-to-access-the-data-in-timed-and-plot-directly/37692)

First you have an issue, you declare a function fib then declare fib as an array…so things go weird. If I rename your function to `fib1` things work better…

This might not be the most elegant way of doing this but:

```julia
function record(f, a)
    val, time, bytes, gctime, memallocs = @timed f(a)
    (time=time, bytes=bytes, gctime=gctime, memallocs=memallocs)
end

x=[1:3]
fib=[fib1, fib2, fib3]
y= [record(fib[i], 10).time for i = 1:3]
using Plots
plot(x,y)

```

If you want bytes you can change .time to .bytes when setting Y.

---

_[View the full topic](https://discourse.julialang.org/t/plot-using-timed/37714)._
