C++11부터 제공되는 기능으로,
현재 스레드를 주어진 시간(여기서는 300 밀리초) 동안 정지시키는 역할을 합니다.
std::this_thread::sleep_for(std::chrono::milliseconds(300));
#include <chrono>
#include <thread>
int main() {
// 300 밀리초 동안 현재 스레드를 일시 정지
std::this_thread::sleep_for(std::chrono::milliseconds(300));
// 다음 작업을 수행
// ...
return 0;
}
업무에 필요한 상황이 생겨서 찾아보고 적용한 코드입니다.
잘 동작하네요 :)
728x90
반응형
'C, C++' 카테고리의 다른 글
C++ vector(벡터)를 써보자 (0) | 2023.06.30 |
---|---|
C언어 포인터(pointer)의 의미론적 설명과 느낌 (0) | 2023.04.16 |
windows 10에서 C언어 환경 구성하기 (0) | 2022.10.02 |