Home » , » Menampilkan Total Waktu Memuat Halaman

Menampilkan Total Waktu Memuat Halaman

<div id="load-time">Calculating page load time...</div>
<script type="text/javascript">
var showTime = document.getElementById('load-time'),
startTime = (new Date()).getTime(); // Get the time before `window.onload`

window.onload = function() {
// Get the current time in `window.onload`
var endTime = (new Date()).getTime();
// Now use the `startTime` and `endTime` to calculate the seconds
// And show the result inside `#load-time`
showTime.innerHTML = "Page load time = " + ((endTime-startTime)/1000) + " sec(s).";
};
</script>
Jika Anda menyukai Artikel di blog ini, Silahkan klik disini untuk berlangganan gratis via email, dengan begitu Anda akan mendapat kiriman artikel setiap ada artikel yang terbit di Creating Website

0 comments:

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Homtimpa - All Rights Reserved
Template Modify by Creating Website
Proudly powered by Blogger