Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thread::sleep_ms(1000) #350

Open
Gresand opened this issue Jan 1, 2024 · 0 comments
Open

thread::sleep_ms(1000) #350

Gresand opened this issue Jan 1, 2024 · 0 comments

Comments

@Gresand
Copy link

Gresand commented Jan 1, 2024

Hi all! I'm a newbie, don't judge too harshly. On page 44 and below, the thread::sleep_ms(1000) method is used, which throws an error.

thread::sleep_ms(1000);

use of deprecated function `std::thread::sleep_ms`: replaced by `std::thread::sleep`

As written in the footnote, we need to use use::time, I don’t know to what extent this is true.

use std::time;

let ten_millis = time::Duration::from_millis(1000);
thread::sleep(ten_millis);

sleep_ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant