I'm not gonna write it out for you, but basically you include a hidden variable inside your form that has the current time.
IE, you have a php file that has your form in it. In the form, in a hidden variable, you include something like <? time(); ?> for the hidden input's value. Then in your processor script, you subtract the first time from the time at which the processor script was loaded, and that'll tell you how many seconds the person was on the form.
Lookup the time function on php.net to find out more
Kevin