Coroutines and async/await 160 date: Tue, xx xxx xxxx 21:06:05 GMT Hello World4 ELAPSED TIME: 10. 043025 So, you see that our code runs as expected. Since we called wait on every call to Http::get, the code ran sequentially, which is evident when we look at the elapsed time of 10 seconds. That makes sense since the delays we asked for were 0 + 1 + 2 + 3 + 4, which equals 10 seconds. What if we want our futures to run concurrently? Do you remember we talked about these futures being lazy? Good. So, you know that we won't get concurrency just by creating a future. We need to poll them to start the operation. To solve this, we take some inspiration from Tok io and create a function that does just that called join_all. It takes a collection of futures and drives them all to completion concurrently. Let's create the last example for this chapter where we do just this. c-async-await—concurrent futures Okay, so we'll build on the last example and do just the same thing. Create a new project called c-async-await and copy Cargo. toml and everything in the src folder over. The first thing we'll do is go to future. rs and add a join_all function below our existing code: ch07/c-async-await/src/future. rs pub fn join_all<F: Future>(futures: Vec<F>)-> Join All<F> { let futures = futures. into_iter(). map(|f| (false, f)). collect(); Join All { futures, finished_count: 0, } }