Design Pattern Examples
Overview of object-oriented design patterns
sleep.cpp
Go to the documentation of this file.
1
5
6#include <chrono>
7#include <thread>
8
9#include "sleep.h"
10
11namespace Helpers
12{
13
14 // Sleep for the specified number of milliseconds.
15 void sleep(int milliseconds)
16 {
17 std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds));
18 }
19
20} // end namespace
Declaration of the sleep function, for sleeping for a number of milliseconds.
The namespace containing all the "helper" functions in the C++ code.
void sleep(int milliseconds)
Sleep for the specified number of milliseconds. Does not return until after the sleep period.
Definition: sleep.cpp:15