Is there any way to measure the number of milliseconds between mouse press and release?
Is there any way to measure the number of milliseconds between mouse press and release?
I think this is the most elegant way:
function onMouseDown(e) {
window.onmouseup = function(e2) {
var diff = e2.timeStamp - e.originalEvent.timeStamp;
console.log(diff);
window.onmouseup = null;
};
}