How do you make a set fire rate for shooting in a 2D Sidescroller?

This would work for non-automatic style shooting: