Skip to content

Commit

Permalink
Ch. 17§04 initial edits on intro and “Yielding” section
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskrycho committed Jul 8, 2024
1 parent cc0f913 commit 1030015
Show file tree
Hide file tree
Showing 21 changed files with 448 additions and 707 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@ fn main() {
// ANCHOR: slow-futures
let a = async {
println!("'a' started.");
slow("a", 300);
slow("a", 100);
slow("a", 200);
slow("a", 900);
slow("a", 30);
slow("a", 10);
slow("a", 20);
trpl::sleep(Duration::from_millis(50)).await;
println!("'a' finished.");
};

let b = async {
println!("'b' started.");
slow("b", 750);
slow("b", 100);
slow("b", 150);
slow("b", 75);
slow("b", 10);
slow("b", 15);
slow("b", 350);
slow("b", 150);
trpl::sleep(Duration::from_millis(50)).await;
println!("'b' finished.");
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,24 @@ fn main() {

let a = async {
println!("'a' started.");
slow("a", 300);
slow("a", 30);
trpl::sleep(one_ms).await;
slow("a", 100);
slow("a", 10);
trpl::sleep(one_ms).await;
slow("a", 200);
trpl::sleep(one_ms).await;
slow("a", 900);
slow("a", 20);
trpl::sleep(one_ms).await;
println!("'a' finished.");
};

let b = async {
println!("'b' started.");
slow("b", 750);
trpl::sleep(one_ms).await;
slow("b", 100);
slow("b", 75);
trpl::sleep(one_ms).await;
slow("b", 150);
slow("b", 10);
trpl::sleep(one_ms).await;
slow("b", 350);
slow("b", 15);
trpl::sleep(one_ms).await;
slow("b", 150);
slow("b", 35);
trpl::sleep(one_ms).await;
println!("'b' finished.");
};
Expand Down
Loading

0 comments on commit 1030015

Please sign in to comment.