Delaying a button

Am I able to put a delay on a button? for example to stop the user clicking through a set of images too quickly?

Here’s my code I spliced together after searching:

previous_btn.onRelease = function() {
prevImage();
previous_btn.enabled= false;
delay = 2000;
previous_btn.enabled= true;

};
next_btn.onRelease = function() {
nextImage();
previous_btn.enabled= false;
delay = 2000;
previous_btn.enabled= true;
};

Can someone please help :cowboy: