Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A simple JS code snipet for Print Page Load Time in Second.
• Obiviously you don't need jQuery and notify.js . Just remove two CDN link and remove $.notify(notify_msg, "success");
<div class="classname">
<img src="" alt="">
<!-- put everything you need in here -->
<script src=""></script>
<script src=""
integrity="sha256-7NgI/5l45Md7VEbs4MGG4HsRoHu+lXKQ/vUK1LvXDps=" crossorigin="anonymous"></script>
window.onload = function () {
var loadTime = window.performance.timing.domComplete - window.performance.timing.navigationStart;
var loadTimeInSec = loadTime / 1000;
var notify_msg = 'Page load time is ' + loadTimeInSec + ' s';
$.notify(notify_msg, "success");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment