The await keyword suspends execution of an async function until a Future completes, while block_on runs an async block to completion on the current thread, blocking it until the result is ready. Use await inside async functions to pause and resume tasks, and use block_on in synchronous entry points like main to start the async runtime.
use std::time::Duration;
fn main() {
trpl::block_on(async {
println!("Starting async task");
trpl::sleep(Duration::from_millis(500)).await;
println!("Task complete");
});
}