It totally depends what the spasms are from. Spasms result from irritation to the nerves.
If your spasm is the result of over-stretching the muscles (whip lash) the spasms may last a couple of days. If on the other hand it is the result of herniated discs that may go on for weeks or even months until the disc quietes down.
If it goes on for more than 3-4 days pls see a doc.
Hope that helps.