My suggestion would look like this:
$('button').click((function() {
var history = [],
last = +new Date();
return function(e) {
history.push(e.timeStamp - last);
console.log(history[history.length - 1]);
last = e.timeStamp;
};
}()));
This will output and save the difference between two clicks in milliseconds. You can use the history array to get the average and check if it's less than 50 ms or something like that.
Demo : http://jsfiddle.net/TxKjT/
: http://jsfiddle.net/TxKjT/2/