Avoid first thread sleeping 0 millis

This commit is contained in:
Donald Guy 2021-05-04 21:38:18 -04:00 committed by GitHub
parent 1cd661997c
commit e696f987cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,7 @@ struct JobStatus {
fn main() {
let status = Arc::new(JobStatus { jobs_completed: 0 });
for i in 0..10 {
for i in 1..=10 {
let status_ref = Arc::clone(&status);
thread::spawn(move || {
thread::sleep(Duration::from_millis(250 * i));