# How to measure time in spawned process?

**URL:** <https://discourse.julialang.org/t/how-to-measure-time-in-spawned-process/25383>\
**Category:** New to Julia\
**Tags:** parallel\
**Created:** [June 18, 2019, 1:56am UTC](https://discourse.julialang.org/t/how-to-measure-time-in-spawned-process/25383 "2019-06-18T01:56:00Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [June 18, 2019, 10:52am UTC](https://discourse.julialang.org/t/how-to-measure-time-in-spawned-process/25383/3 "2019-06-18T10:52:33Z")

</div>

> [@c42f](#):
>
> You could use `@timed` and manage the formatting of the output yourself, gathering this information back to the main task and doing the IO there.

Yes.

See the thread below for an example using this technique to benchmark function calls that are distributed with `pmap`:

> [@How to benchmark distributed function calls?](https://discourse.julialang.org/t/how-to-benchmark-distributed-function-calls/21319/2):
>
> Most likely, you’re what you’re seeing here is only the memory consumption of some launching process (which has to wait for spawned tasks to complete, and can thus measure the correct elapsed time). In order to get a total memory consumption, I don’t know of any other way than to benchmark individual spawned tasks. Here is a complete example: Sequential version First, a plain, sequential version to be used as reference: julia\> using BenchmarkTools julia\> f\_seq(n) = map(1:n) do i …

---

_[View the full topic](https://discourse.julialang.org/t/how-to-measure-time-in-spawned-process/25383)._
