# How to turn off @threads for ... while debugging

**URL:** https://discourse.julialang.org/t/how-to-turn-off-threads-for-while-debugging/57234
**Category:** New to Julia
**Tags:** threads
**Created:** [March 15, 2021, 8:55pm UTC](https://discourse.julialang.org/t/how-to-turn-off-threads-for-while-debugging/57234 "2021-03-15T20:55:31Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)
#### Post date: [March 15, 2021, 9:26pm UTC](https://discourse.julialang.org/t/how-to-turn-off-threads-for-while-debugging/57234/2 "2021-03-15T21:26:50Z")

</div>

You could create a, say, `@maybethreads` macro which depending on a global switch does the same thing as `@threads` or nothing, respectively. See [@assert alternatives? - #14 by WschW](https://discourse.julialang.org/t/assert-alternatives/24775/14) for a similar example. You might also want to check out [https://github.com/KristofferC/TimerOutputs.jl/blob/master/README.md#overhead](https://github.com/KristofferC/TimerOutputs.jl/blob/master/README.md#overhead).

---

_[View the full topic](https://discourse.julialang.org/t/how-to-turn-off-threads-for-while-debugging/57234)._
