Surgery can take 1 to 2 hours, depending on the type and severity of the hernia.