Drive a Pump

Hello, I am wording a code to drive a pump by using a relay. Quite easy!!
But I need to drive the pump just x seconds after pressing a button. These seconds come taking into account the duration of another push button.

I have perform several manners or working with an unsuccessful results.

On one hand I can not safe the time when the button is pressed.
On the other hand I can not drive the relay by ussing a variable "time" like delay(time) or whatever. I have read that milis function is better but I am not sure.

Can you help me?

Thanks in advance

Save the millis() time when the timer button becomes pressed. Save the millis() time when it is released. The difference is how long to wait before starting the pump after the start button is pressed.

Ebay sells http://www.ebay.com/itm/261197522310?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649
A 5V .5 to 5 L/M pump with a hall effect pulse counter for $5.99 + $0.99 shipping... I just bought two of them for watering my Orchids, one for water and one for feeding.. IHTH..

Doc

Post the code you have, then we can talk in terms of the variables and functions you
already have....