1 | initial version |
You should used an external timer. Get the time before the waitKey call, get the time after, and wait the difference if needed. The functions will depend on your OS, but look at the C++--11x options for time, if your compiler support it.