»
EnglishFrenchVietnamese

Print - Timer - JavaScriptBank.com

Full version: jsB@nk » Calculation » Timer
URL: https://www.javascriptbank.com/timer.html

Timer © JavaScriptBank.comA very simple timer that will tell how much time is spent on one page.

Full version: jsB@nk » Calculation » Timer
URL: https://www.javascriptbank.com/timer.html



JavaScript
<SCRIPT language=JavaScript><!-- startday = new Date();clockStart = startday.getTime();function initStopwatch() {  var myTime = new Date();         var timeNow = myTime.getTime();          var timeDiff = timeNow - clockStart;         this.diffSecs = timeDiff/1000;         return(this.diffSecs); } function getSecs() {         var mySecs = initStopwatch();         var mySecs1 = ""+mySecs;         mySecs1= mySecs1.substring(0,mySecs1.indexOf(".")) + " secs.";         document.forms[0].timespent.value = mySecs1         window.setTimeout('getSecs()',1000); }//--></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<BODY onload="window.setTimeout('getSecs()',1)"><FORM>Time spent on this page: <INPUT size=9 name=timespent></FORM></BODY><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->