After a mild sprain, you may be able to walk on it immediately or the following day. However, a more severe sprain may be painful for weeks (sometimes even longer than a fracture!). Swelling can cause pain itself. This is one of the important reasons to keep the foot/ankle elevated after an injury. Swelling will decrease with time, but can persist if you have been standing, walking, or exercising for a longer time.