A bit of code to limit the iteration of a function to a specific rate