# How does Profile work on non-yielding functions?

**URL:** <https://discourse.julialang.org/t/how-does-profile-work-on-non-yielding-functions/64883>\
**Category:** General Usage\
**Created:** [July 18, 2021, 9:42pm UTC](https://discourse.julialang.org/t/how-does-profile-work-on-non-yielding-functions/64883 "2021-07-18T21:42:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [July 18, 2021, 9:42pm UTC](https://discourse.julialang.org/t/how-does-profile-work-on-non-yielding-functions/64883/1 "2021-07-18T21:42:41Z")

</div>

The Profile module is a statistical profiler, so it checks frequently what the program is doing. I can imagine that works fine if the code has yield points in it (e.g. allocations or I/O or `yield()`), but how does control switch into Profiling from within that CPU-intensive code so it can take a snapshot? If it can’t do that, will my profiles be misleading?
