JSFiddle - React, Tailwind, and code Playground
by nikolya223
HTML
<doctype html>
<html>
<body>
<progress max="400" id="countintimeProgress" ></progress>
</body>
</html>
JavaScript
var vr;
var vr2 = new Array();
var vrstart;
var vrstart2;
var count_press;
timerGlobal =setInterval("document.getElementById('countintimeProgress').value=vr2[vr2.length-1];",100);
vr=new Date();
vrstart = vr.getSeconds();
vrstart2 =vr.getMilliseconds();
count_press=0;
vr2[0] = 0;
vr2[1] =0;
vr2[2] = 0;
vr2[3] = 0;
vr2[4] = 0;
vr2[5] = 0;
vr2[6] = 0;
vr2[7] = 0;
vr2[8] = 0;
vr2[9] = 0;
vr2[10] = 0;
window.onkeydown = function(){
vr=new Date();
vr2[0] = vr2[1];
vr2[1] = vr2[2];
vr2[2] = vr2[3];
vr2[3] = vr2[4];
vr2[4] = vr2[5];
vr2[5] = vr2[6];
vr2[6] = vr2[7];
vr2[7] = vr2[8];
vr2[8] = vr2[9];
vr2[9] = vr2[10];
vr2[10]= (vr.getSeconds()-vrstart+"."+(vr.getMilliseconds()-vrstart2));
}