Chrono timer in C++ to double
问题 How can i create a timer that after a certain duration, it does something? so far i have been trying to use the % operation. I made a timer at the start of the function and subtracted the current time (now()function) then i % the difference by 5 because i want 5 seconds to pass: (at the start of the program i defined start as high_resolution_clock::now()) duration<double> dur = start-high_resolution_clock::now(); if(dur%5==0) the error ive been getting is: no operator "==" matches these