# Timing compilation when using threads

**URL:** https://discourse.julialang.org/t/timing-compilation-when-using-threads/121001
**Category:** Performance
**Tags:** time, threads, compile-time
**Created:** [October 7, 2024, 11:56am UTC](https://discourse.julialang.org/t/timing-compilation-when-using-threads/121001 "2024-10-07T11:56:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![theogf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/theogf/32/1987_2.png) [@theogf](https://discourse.julialang.org/u/theogf)
#### Post date: [October 7, 2024, 11:56am UTC](https://discourse.julialang.org/t/timing-compilation-when-using-threads/121001/1 "2024-10-07T11:56:38Z")

</div>

Is it possible to correctly measure compilation time when using Tasks on separate threads?

I have tried using the 1.11 `@timed` but get inconsistent timings for the compilation time.

I also don’t have a clear picture of what happens compilation-wise when one runs multiple tasks in parallel (multiple threads). Is the JIT-Compilation sequential? If it is is there some kind of lock mechanism that can stop another task while it waits for the compiler to be available?

Thanks
