Programming problem

The problem is that I need the delay :S I need to activate a motor for a certain amount of time (like 1 to 3 secs)