How to add a timer to input.getkey

so i want to make it so that the firerate of a gun is controlled by a short timer while holding my mouse button so that it wont be too fast, how do i do that. I am a beginner so easy to understand language pls

Hello.

As youare a beginer, you should try to make your own scripts. Look manuals, tutorials about anythiong you doesnt know:

Just need to use GerKey() , and inside getkey use Time.deltaTime to count the time it has been pressed. Then use GetKeyUp() to execute what you want. Somethign with this structure:

float timePressed;

GetKeyDown()
{
timePressed =0;
}

GetKey()
{
timePressed += Time.deltaTime;
}

GetKeyUp()
{
Shoot or something using timePressed;
}

Bye!