Message from C, C++ talks

July 2019

— But why do you need to run diffrent functions with n interval?

— How do you differentiate the code being c'ish or c++?

— I guess he wants to avoid function pointers

— But i don't see why and there's std::function


It is a kind of a surveillance program lol, take screenshot at a user-defined interval, send logs to server every n minutes etc

— Using stl versus not using it


void timer_start(std::function<void(void)> func, unsigned int interval)
std::thread([func, interval]()
while (true)
auto x = std::chrono::steady_clock::now() + std::chrono::milliseconds(interval);

I found this from internet, it looks pretty good, just have to figure out how to end/change the interval of already-made periodic function call

Message permanent page

— Mmm malware

— Not really

— I'm not writing a virus

— Spyware

— No

— Control software

— Hm

— Just virus?