Check out example codes for "sleep in c++ linux". It will help you in understanding the concepts better.

Code Example 1

#include <unistd.h>
 sleep(10);

Code Example 2

#include <chrono>
#include <thread>

td::this_thread::sleep_for(std::chrono::milliseconds(x));

Learn ReactJs, React Native from akashmittal.com