How does Urchin calculate average session length

How does Urchin calculate average session length?

The average length of session is calculated by first recording and storing the length of each session as the time difference between the first and last hit of the session. Note that this length does not contain any “virtual” time for viewing the last page.

The calculation has two parts. The base part is:

100% * (total length of sessions / number of sessions).

If there are more pageviews than sessions, we add another amount that estimates the virtual time for the last page. This part is calculated as:

100% * (total length of sessions / (pageviews – sessions)).

Note that this only works well where pageviews is much greater than sessions.