Creating a timer in Unity

I am making a first person shooter and I want to set the fire rate (e.g. if you hold down the fire button, it shoots, then waits for a time, and then shoots again) I was wondering how I would go about scripting this. Thanks!

Use InvokeRepeating with the desired repeat rate when using KeyDown/ButtonDown, and then CancelInvoke on KeyUp/ButtonUp.