it fairly easy: you must somehow save the time after the first login failure and than wait til the time is over. In Windows you can use the
Sleep function.
That logic fits best in an outter loop of your code.
Some meta-code
bool loginSuccess = false;
do {
long startTime = gettime():
loginSuccess = ...;
if( !loginSuccess ) {
Sleep( ... )
}
} while( !loginSuccess );