Forum Moderators: open
Problem is that it's hard on resources... if you end up with a perpetual javascript/DHTML process running in the background, mixed with a couple other memory/cpu intensive browser apps like flash and java (especially java) either on your site or in another browser window you'll get major slow down and hangs on older systems.
By older systems I mean PII's and earlier PIII's.
Kinda kills the professional feel of a site :-)
Most good server log interpreting stat programs can give you a very good idea of how long visitors are spending on your site.
<script language="Javascript">
<!--
hi = new Date();
function visitTime() {
bye = new Date();
minutes = (bye.getMinutes() - hi.getMinutes());
seconds = (bye.getSeconds() - hi.getSeconds());
time = (seconds + (minutes * 60));
if (time == 1) {
time = (time + " second");
}
else {
time = (time + " seconds");
}
alert('You visited this page for ' + time );
}
//-->
</script>
<body OnUnload="visitTime()">