how to set a timeout for button press..??

I am using buttons in one of my project.. I would like to set a timeout..

for example if i press one button the program enters a menu or settings mode..then user does a job..

but if no buttons are pressed within a certain time it the LCD will go back to its home screen.

Please give me an idea how to set the timeout of the button press...??

some code will be much better ;)

I am using buttons in one of my project..

Does that involve clothing? If it's an electronic project, switches would be more appropriate.

Please give me an idea how to set the timeout of the button press...??

You can't.

What you need to do is record when the "display the menu" switch was pressed. Record when any subsequent "interact with the menu" switches are pressed.

Periodically, see if now (millis()) minus then exceeds some value. If so, change what the Arduino is doing (take the menu down).