var touchtime = new Date().getTime();
$("#btn1").on("click", function(){
if( new Date().getTime() - touchtime < 500 ){
console.log("dblclick");
}else{
touchtime = new Date().getTime();
console.log("click")
}
});