Home > front end >  Js timer
Js timer

Time:10-24

Js timer sets the initial time and display from the initial time to now a total of how much time of complete code

CodePudding user response:

For the answer of thanks

CodePudding user response:

 
<script>
Var startTime=Date. Now ()
Var endTime='
SetInterval ()=& gt; {
EndTime=Date. Now ()
Document. The body. The innerHTML='start time: "+ new Date (startTime) +' & lt; br> Current time: "+ new Date (endTime) + '& lt; br> Elapsed time: '+ ((
The endTime - startTime)/1000). ToFixed (0) + 'seconds'
}, 1000)
</script>

CodePudding user response:

Var start=new Date (" the 2019-11-17 19:10). GetTime ();
Var end=new Date (). GetTime ();
The console. The log ((end - start)/1000);//s
I am a rookie, phone dozen don't know right

CodePudding user response:

Var start=new Date (" the 2019-11-17 19:10). GetTime ();
Var end=new Date (). GetTime ();
The console. The log ((end - start)/1000);//SEC.
  • Related