A simple way to limit how often a function is executed.