Getting wrong value for Millisecond delay
问题 I am trying to get 1 millisecond delay but i am getting 15 times higher.I have also tried with windows Sleep(1) function which was also giving me the same result. why am i not getting exact millisecond delay? Where as it works with 1 second delay. #include <iostream> #include <Windows.h> #include <thread> #include <chrono> void counter1(); auto main() -> int { std::thread p(&counter1); p.join(); return 0; } void counter1() { int nStep = 0; const int STEP = 1000; auto start = std::chrono::high