During surgery, your eye doctor will remove the cloudy lens from your eye and replace it with an artificial lens (called an intraocular lens, or IOL). The surgery lasts about 1 hour and is almost painless. Usually, you'll be awake during cataract surgery.