This type of thing is normally handled automatically via your web site logs, and only needs to be included if your server provider does not include such in your hosting package. Check with your server provider to see if they include such a program.
Most analytics tools will also tell you this information. If you have Google Analytics, SiteCatalyst, CoreMetrics, WebTrends: each of these tools and the rest of the myriad of tools have Avg. Time on Page metrics.