I want it to register an input A and then wait for 10 seconds, if another input B is registered within that time, it gives an output to the relay.
How long is the relay to be closed?
anyway:
long mostRecentInputA = millis() - 10000;
void loop() {
if(there's an input A) {
mostRecentInputA = millis();
}
if(theres an input B) {
if(millis() - mostRecentInputA <= 10000) {
send output to relay;
}
}
}