Switch Timer please help

There all,

I need help how do a get a switch to turn off and then after 5 - 10 seconds turn on - it’s to restart my router so when it goes off no internet so no on again

Delay does not seem to work

for(int i = 0; i < 5; i++)
{
rfWriteCode(RF_OUT, RF_OSC, ID3, OFF);
delay(5000);
rfWriteCode(RF_OUT, RF_OSC, ID3, ON);
delay(5000);
rfWriteCode(RF_OUT, RF_OSC, ID3, ON);

thanks

Worked it out thanks