javascript, keep button fast clicking~
<p>in html, I make a button.
the button should click one time per second.
I do not want to permit fast button clicking~</p>

<p>so my code is here</p>

<pre><code>inputTooFast = function()
{
    var curDate = new Date();
    if(curDate.getHours() == this.lastinputtime[0])
        if(curDate.getMinutes() == this.lastinputtime[1])
            if(curDate.getSeconds() == this.lastinputtime[2])
                if((curDate.getMilliseconds() - this.lastinputtime[2]) &lt; 999)
                {
                    this.lastinputtime[0] = curDate.getHours();
                    this.lastinputtime[1] = curDate.getMinutes();
                    this.lastinputtime[2] = curDate.getSeconds();
                    this.lastinputtime[3] = curDate.getMilliseconds();
                    return true;
                }
    this.lastinputtime[0] = curDate.getHours();
    this.lastinputtime[1] = curDate.getMinutes();
    this.lastinputtime[2] = curDate.getSeconds();
    this.lastinputtime[3] = curDate.getMilliseconds();
    return false;
}
</code></pre>

<p>and sample usage is here</p>

<pre><code>function sendMessage()
{
    if(theObj.inputTooFast()==true)
        return;

 ...
   some valid code here
 ...

}
</code></pre>

<p>so, is there any faster or better solution to do this?
I am using jquery.</p>
