src/main.rs:
xuse std::{time::Duration};use tokio::{runtime::Handle};
fn main() { let runtime = tokio::runtime::Builder::new_multi_thread() .worker_threads(10) .enable_all() .build() .unwrap();
let fut = runtime.spawn( async move { let handle = Handle::current(); println!("{:#?}", handle); } ); runtime.block_on(fut).unwrap(); std::thread::sleep(Duration::from_secs(3));}cargo.toml:
xxxxxxxxxxdependenciestokio = version = "1.16.1" features = "full"