A script that marks the start-time for that IP#, then an "onunload" posting to it to mark the "leaving-time" is probably your only real viable option. While others may think of another way (if so, please educate me

), that (an onunload event) is the only solution outside Ajax that I can think of. With Ajax, you could continually call a timer from a PHP script. The problem with doing that is that you would want (to get a good "average") to have it call the time atleast every second, and the bandwidth will end up killing you if you used this Ajax method
Possibly a combo of the two: calling the PHP script on "onload", then again on "onunload", both via Ajax, might do the trick for you
