Example improvements by Rqnsom · Pull Request #1552 · rust-lang/rust-by-example (original) (raw)

Sometimes 5 apples are printed, sometimes 3 apples...
Let's rather have deterministic behavior with all 10 apples getting printed on the screen.

Joining threads could be used, but that concept is later introduced in 20.1. Threads, so I prefer simple sleep here.