IR sensor proximity

dear sir
please i need help

i'm working on a project : i want switch on led for 1 second and switch off led , even IR sensor still active
for example : when IR sensor detect obstacle turn led on 1 sencond and turn led off even the obstacle still
active

thanks

Look at the Blink Without Delay example in the IDE (File->Examples->02.Digital->Blink Without Delay)

thank sir i hope to understand what i want

for example if switch pressed turn led on for 1 second then switch off led even the button still pressed