You can use the .time_event() method (JavaScript) or .timeEvent() (Android) to measure the duration between when a user lands on a page and when they leave. The elapsed time is automatically recorded as a "Duration" property on the tracked event.
JavaScript example:
// When user arrives on the page
mixpanel.time_event('Page Viewed');
// When user leaves the page
mixpanel.track('Page Viewed', { "page": "/pricing" });
// This will include a "Duration" property with the time spent in seconds[Timing Events JS]