How does Profile work on non-yielding functions?

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?