Like as we do in jQuery, I need in angular:
var loadTime = window.performance.timing.domContentLoadedEventEnd - window.performance.timing.navigationStart;
var loadTimeinsec = (loadTime / 1000).toFixed(1);
--------------------------------------------------------------
Can anyone please suggest the common way/method to get page load time in angular.
Loading

Sachin SinghPosted Aug 26, 2021, 10:42 AM
Since Angular is a modern typescript-based framework that offers dynamic web pages, it provides some challenges in monitoring its performance and load time. It is troublesome to accurately measure when new content is rendered on the page because SPAs do not trigger new navigation in the browser once the web page has loaded. Therefore, HTTP-monitoring tools (and also API monitoring tools) will not provide significant metrics to optimize load times since Angular does not trigger new browser requests to the server.
LoadView
LoadView proposes an innovative and holistic solution to approach the limitations of HTTP-monitoring tools and strengthen the tools Angular developers have today to control, monitor and optimize their applications on the client-side. LoadView is a cloud-based load-testing platform that offers stress test monitoring of websites, web applications, and APIs by simulating thousands of concurrent connections in real-time, helping to identify bottlenecks and verify overall performance.
The short answer is, you can only know the initial page load time, which doesn't help in any way, after hosting however you can determine the performance by various available tools.
I personally use SEO tools, available on market, to determine page load time for each request.
The below code is just for time taken for initial (First) run
ngAfterViewInit(){
console.log("Time take till reaching run phase: ", Date.now() - $window.timerStart);
}