'How to capture Page Speed of NextJS App when the internal route changes

How capture page speed data of NextJS App when the internal route changes? My pages does not refresh on route change. i make api calls to fetch data for that page and render it on the route.

i tried using NextJS reportWebVitals API but it is giving me the wrong data.

Is there any better way to capture the page load time of the NextJS app on internal route change?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source