Get the time spent by the user on a specific page before moving to another specific page

Hello,
Can we get the minimum, maximum, average and median time spent by the user on a specific page (page 1) before moving to another specific page (page 2) in Matomo? If this is not possible using the standard Matomo and its plugins, we can create a custom dimension with the URI / URL of the next page, and then create a Matomo segment with the following conditions: 1) “Page URL” with the URL of page 1, for which we want to know how many the user spent time on it before going to page 2 2) “Next page custom dimension” with the URI/URL of page 2. Can we get what we want in Matomo reports using such custom dimension and Matomo segment?