Simulate Timer In C++11

The following content involves the concepts of synchronous and asynchronous. Here is a C++ class that simulates a timer. Output asynchronously. To simulate a timer for sequentially outputting numbers, we can do it like this: We cannot execute the task of rendering frames by creating a new thread in this Read more…

std::thread and std::mutex

std::thread #include <iostream> #include <thread> #include <chrono> void f1(int n) { for (int i = 0; i < 5; ++i) { std::cout << “function f1 executing\n”; ++n; std::this_thread::sleep_for(std::chrono::milliseconds(10)); } } void f2(int& n) { for (int i = 0; i < 5; ++i) { std::cout << “function f2 executing\n”; ++n; Read more…

Tex To PDF
: convert the Latex file which suffix is tex to a PDF file

X