Skip to content

Commit

Permalink
fix: nonblocking sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Apr 26, 2024
1 parent 5a09dea commit e6f29d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/SymbolicRegression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,11 @@ function _main_search_loop!(
)
end
end
Libc.systemsleep(1e-6)
let
t = Threads.@spawn Libc.systemsleep(1e-6)
yield()
fetch(t)
end
# Regular sleep has issues:
# https://discourse.julialang.org/t/julia-seems-an-order-of-magnitude-slower-than-python-when-printing-to-the-terminal-because-of-issue-with-sleep/78151/44

Expand Down

0 comments on commit e6f29d8

Please sign in to comment.