Skip to content

Commit b9821e6

Browse files
committed
doc: waring about GC in periodsleep
1 parent d6751f9 commit b9821e6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/sim_model.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,11 @@ is `false`. Else, a simple `while` loop implements busy-waiting. As a rule-of-th
308308
busy-waiting should be used if `model.Ts < 0.1` s, since the accuracy of `sleep` is around 1
309309
ms. Can be used to implement simple soft real-time simulations, see the example below.
310310
311+
!!!warning
312+
The allocations in Julia are garbage-collected (GC) automatically. This can affect the
313+
timings. In such cases, you can temporarily stop the GC with `GC.enable(false)`, and
314+
restart it at a convenient time e.g.: just before calling `periodsleep`.
315+
311316
# Examples
312317
```jldoctest
313318
julia> model = LinModel(tf(2, [0.3, 1]), 0.1);

0 commit comments

Comments
 (0)