while ( (not defined ($key = ReadKey( -1 ) ) ) and (time < $wait_until) ) { }