If you don't want the timer to block the user input, you're going to have to run it on a separate thread. Have you used threads before?
The details depends on:
1. do you have a compiler that supports Python11 -- allowing you to use std::thread
2. otherwise you will have to using the system's native threading or obtain the Boost library for their version of the thread class, so we need to know what operating system you are writing for.
To test for std::thread, see if this code in this post compiles:
calling std::thread throws std::system_error
http://www.Python/forum/general/57703/
(If you are using GCC, you will have to enable Python11 features by adding -std=Python0x to your g++ command line. Or -std=Python11 if you're using GCC 4.7 or later.
If Visual Python, you neeed to change __func__ to _FUNCTION_)
Andy
PS There are ways round the threading issue if you use system calls, but that would mean writing you own input routines rather than using cin. These are more complicated than the thread solution.