setInterval

ok, i have a question. Can anyone tell me how the setInterval command works?

i want it so that after you fire a laser from your spaceship, it takes 0.5 seconds to fire another.

thx.