Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Samrat Shrestha This snipped work for you
- <doctype html>
- <html>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">
- </script>
- <head>
- <script type="text/javascript">
- $(document).ready(function() {
- console.log("Time until DOMready: ",window.performance.timing.loadEventEnd-window.performance.timing.navigationStart);
- });
- </script>
- <!-- do all the stuff you need to do -->
- </head>
- <body>
- </body>
- </html>
- The ready event occurs after the HTML document has been loaded,
- you not able to get page loading end time during window.onload (page loading).
- https://stackoverflow.com/questions/3698200/window-onload-vs-document-ready
- https://developer.mozilla.org/en-US/docs/Web/API/Navigation_timing_API#Examples
- https://developer.mozilla.org/en-US/docs/Web/API/PerformanceTiming/loadEventEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement