How to calculate session duration?

can you please state with an example, as the description in docmn is not tallying with the values in my insights page.

@Nikhitha The time taken by user to send each response is tracked and stored under the session_sum field on the Message events table. We take the total of that and divide it by the unique number of sessions to calculate average session duration.

Where do we get the unique number of sessions, can we consider the sessions KPI under Users Traffic in Insights page?

How does the result appear in min and sec in Session duration. Is there anything to add in the calculation logic.?

@Nikhitha Yes, we use the Sessions metric under User Traffic. The session_sum is in seconds so the resultant session duration is also in minutes and seconds.