User Tools

Site Tools


c:c_threads:pause_current_thread

C - C++ Threads - Pause current thread

pause.hpp

#pragma once
 
void pause(int milliseconds);

pause.cpp

#include "pause.hpp"
#include <thread>
#include <chrono>
 
void pause(int milliseconds)
{
  std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds));
}

References

c/c_threads/pause_current_thread.txt · Last modified: 2021/04/28 09:13 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki