I would like help with this timer using <chrono> instead of <ctime> to get the current time and duration so it doesn't pause my whole program when I run it.
This code looks like it will be in a very tight loop, except you bounce out of the loop after one pass by setting flag to false. I'm not quite sure what you're trying to do here.
I tried this one before ne555 it still pauses the whole process
1 2 3 4 5 6 7 8 9 10
for (i = 0; i < mtimer_size; i++) {
if (state != 0 && boost::regex_match(mtimer_array[i][0].c_str(), matches, re)) {
string str1 = mtimer_array[i][1];
int myint1 = stoi(str1);
std::this_thread::sleep_for(std::chrono::seconds(myint1));
//blocking mic
//unblocking mic
}
}