# @timed to plot the time and memory consumption

**URL:** https://discourse.julialang.org/t/timed-to-plot-the-time-and-memory-consumption/37477
**Category:** General Usage
**Tags:** question, plotting
**Created:** [April 13, 2020, 12:23am UTC](https://discourse.julialang.org/t/timed-to-plot-the-time-and-memory-consumption/37477 "2020-04-13T00:23:13Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Iagoba\_Apellaniz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iagoba_apellaniz/32/34406_2.png) [@Iagoba\_Apellaniz](https://discourse.julialang.org/u/Iagoba_Apellaniz)
#### Post date: [April 13, 2020, 9:40am UTC](https://discourse.julialang.org/t/timed-to-plot-the-time-and-memory-consumption/37477/4 "2020-04-13T09:40:49Z")

</div>

Hey Amrusama! Welcome!

You can find this thread useful for getting the time [How to save @time output in a file or variable?](https://discourse.julialang.org/t/how-to-save-time-output-in-a-file-or-variable/11218) I’ll try to find something for the memory consumption. Maybe some hack over `@time`??

UPDATE: I guess that the second value of `@timed` is for the time and the third is for the memory. Since the first is for the result, you can collect all three in a row. NOT working example, this is only to explain myself,

```julia
julia> for i in 1:100
           rows[i] = (@timed i^2)[1:3]
       end

julia> plot(1:100, [rows[i][1] for i in 1:100]) # for the result of ^2

julia> plot(1:100, [rows[i][2] for i in 1:100]) # for the timing

julia> plot(1:100, [rows[i][3] for i in 1:100]) # for the memory

```

I guess that there are better options to do this.

---

_[View the full topic](https://discourse.julialang.org/t/timed-to-plot-the-time-and-memory-consumption/37477)._
