O'Reilly logo
  • Ivan Zderadicka thinks this is interesting:

thread::sleep(Duration::from_secs(5));

From

Cover of Rust High Performance

Note

This is not good example for future - thread::sleep here will block main thread and then return resolved future. println!("Doing some other things while our result gets generated") is just called after this some_complex_computation returns. Future's value is then retrieved in block_on call.