I have a function that starts on mouse wheel scroll but, if i do a longer scroll, it executes for 2-3 times. So i have to find a way to prevent it running if it is called more then 1 time in 2 sec let's say. Any ideas?

PS : this is my function. if you know a better way to start it on scroll and not taking in consideration how long it's the scroll, i would appreciate it as well.

```
if (window.addEventListener) {
// IE9, Chrome, Safari, Opera
window.addEventListener("mousewheel", MouseWheelHandler, false);
// Firefox
window.addEventListener("DOMMouseScroll", MouseWheelHandler, false);
}
// IE 6/7/8

var s = 0;
function MouseWheelHandler(e) {

// cross-browser wheel delta
var e = window.event || e; // old IE support
var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));     
e.preventDefault();
                ...
 }

```

UPDATE: I worked out my own version of the code, based on the ideas that i've read in the comments and answers. This is it :

```
function MouseWheelHandler(e) {
var e = window.event || e;   

// cross-browser wheel delta
 // old IE support
var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));     
 e.preventDefault();
GoUpDown(delta,e);

}
function GoUpDown(delta,e) {
                        if(timer ==0){ timer =1;
                            setTimeout(function () {timer =0;},4200);
  /*function stuff*/
}

```