[记]Rust全局变量+多线程
摘要:
~~~rust static mut Gods: f32 = 0.0; fn main() { std::thread::spawn(|| loop { unsafe { Gods += 1.0; } esleep::s(1);//延时1s }); std::thread::spawn(|| loo 阅读全文
posted @ 2023-07-20 14:07 戳人痛处 阅读(72) 评论(0) 推荐(0) 编辑