Menampilkan Total Waktu Memuat Halaman
<div id="load-time">Calculating page load time...</div>
<script>
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>
Labels: JavaScript, Potongan
15 Comments:
ini mirip script yg digunakan web2 penghitung load suatu blog kah?
By Anonymous, at Friday, March 8, 2013 at 8:35:00 PM GMT+7
mantap gan,ijin praktek gan.gan kalau bikin komentar kaya agan ada nggak tutorialnya tapi yang mirip di pakai disini.
By zigzoor, at Friday, March 8, 2013 at 9:54:00 PM GMT+7
Ini semacam cek berat blog yah (kalo kata orang sih gitu :D )
http://www.iwebtool.com/tool/tools/speed_test/speed_test.php?domain=http%3A%2F%2Fwww.dte.web.id%2F
keren...
By Unknown, at Saturday, March 9, 2013 at 11:44:00 AM GMT+7
mas kalo mau otomatis menghilang saat sudah terlihat waktu loadnya gmn ya ?
chek di sini http://nevermore-404.blogspot.kr/p/demopage.html 7:(
By Anonymous, at Sunday, March 10, 2013 at 5:44:00 AM GMT+7
mas menampilkan waktu halaman dan waktu tanggal bersamaan kayak blog ini bagaimana pak : http://sdftyujklvbn.blogspot.com/
http://3.bp.blogspot.com/-b3_bL7zViyA/UTwiN-07T7I/AAAAAAABn48/7wx7l259tD8/s1600/Untitled-1.jpg
By Anonymous, at Sunday, March 10, 2013 at 1:04:00 PM GMT+7
manteb banget mas..
By Fajrin, at Sunday, March 10, 2013 at 2:34:00 PM GMT+7
var showTime = document.getElementById('load-time'),
startTime = (new Date()).getTime();
window.onload = function() {
var endTime = (new Date()).getTime();
showTime.innerHTML = "Page load time = " + ((endTime-startTime)/1000) + " sec(s).";
setTimeout(function() {
showTime.style.visibility = "hidden"; // Menghilang 3 detik kemudian...
}, 3000);
};
By Taufik Nurrohman, at Sunday, March 10, 2013 at 9:20:00 PM GMT+7
Gabungkan dengan script-script ini ⇒ Link 1, Link 2
By Taufik Nurrohman, at Sunday, March 10, 2013 at 9:23:00 PM GMT+7
sudah work. thanks mas
By Anonymous, at Monday, March 11, 2013 at 12:28:00 PM GMT+7
halo mas, kembali lagi :-bd
bagaimana penerapan page views pada halaman posting blog :
http://3.bp.blogspot.com/-klqCGXZ7w8o/UT_k63qlIoI/AAAAAAABqtE/fhexmbb2i8A/s1600/Untitled-1.jpg
link yg dimaksud di web ini: http://unik-aneh.lintas.me/article/infoxspot.com/10-orang-yang-kaya-mendadak-karena-kejadian-yang-tidak-disengaja
By Anonymous, at Wednesday, March 13, 2013 at 9:33:00 AM GMT+7
Untuk Blogger tidak bisa.
By Taufik Nurrohman, at Wednesday, March 13, 2013 at 5:44:00 PM GMT+7
tutorial mantab :)
By Bima A., at Friday, April 12, 2013 at 11:33:00 PM GMT+7
dicoba deeh gaan..
:yaya:
By Unknown, at Tuesday, May 7, 2013 at 1:56:00 AM GMT+7
klo pengen loading lebih dari sekian detik muncul tulisan seperti "Terlalu lama, gunakan versi dasar .." bagaimana ???
By Yusril Ibnu Maulana, at Saturday, May 10, 2014 at 5:37:00 PM GMT+7
setTimeout(function() {
if (showTime.innerHTML === "") {
showTime.innerHTML = 'Terlalu lama!';
}
}, 10000); // 10 detik
By Taufik Nurrohman, at Saturday, May 10, 2014 at 9:47:00 PM GMT+7
Post a Comment
<< Home