Gunter
The only problem with your code is that will not spawn a bullet every time the W key is pressed unless its been 3 seconds since the last bullet spawned. So for instance the first time you shoot you'll have to wait 3 seconds to see anything.
Klungland
You could however combined W pressed and W down to achieve what you want: