<!DOCTYPE html>
<
html
>
<
head
>
<
title
>
DOM console.timeEnd() Method
</
title
>
</
head
>
<
body
>
<
h1
style
=
"color: green"
>
GeeksforGeeks
</
h1
>
<
p
>DOM console.timeEnd() Method</
p
>
<
p
>
Clicking the START TIMER button starts
the timer with label 'timer 1'.<
br
>
Clicking the END TIMER button ends the
timer with label 'timer 1'.
</
p
>
<
button
onclick
=
"start_timer_one()"
>
Start Timer 1
</
button
>
<
button
onclick
=
"end_timer_one()"
>
End Timer 1
</
button
>
<
p
>
Clicking the START TIMER button starts
the timer with label 'timer 2'.<
br
>
Clicking the END TIMER button ends the
timer with label 'timer 2'.
</
p
>
<
button
onclick
=
"start_timer_two()"
>
Start Timer 2
</
button
>
<
button
onclick
=
"end_timer_two()"
>
End Timer 2
</
button
>
<
script
>
// Start first timer
function start_timer_one() {
console.log('timer 1 started');
console.time('timer 1');
}
// End first timer
function end_timer_one() {
console.timeEnd('timer 1');
}
// Start second timer
function start_timer_two() {
console.log('timer 2 started');
console.time('timer 2');
}
// End second timer
function end_timer_two() {
console.timeEnd('timer 2');
}
</
script
>
</
body
>
</
html
>