Created
May 1, 2015 23:42
-
-
Save ersingencturk/433ff75051c817a0ef5a to your computer and use it in GitHub Desktop.
measure touch to click delay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var button = document.querySelector( "button" ), | |
span = document.querySelector( "span" ), | |
delay; | |
button.addEventListener( "touchend", function() { | |
delay = Date.now(); | |
}); | |
button.addEventListener( "click", function() { | |
console.log( Date.now() - delay); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment