Is there an alternative to std::this_thread::sleep_for that receives std::stop_token besides time duration?

  c++, c++20, multithreading

I would like to use std::this_thread::sleep_for and std::this_thread::sleep_until with std::stop_token where the functions return if stop is requested on std::stop_token (ex. jthread destruction is called).
How can I achieve this?

Source: Windows Questions C++

LEAVE A COMMENT