This is a prospective, randomized controlled clinical trial to evaluate the efficacy and safety of intravenous patient controlled analgesia (IVPCA) in patients following major intracranial surgery (e.g. brain tumors, vascular surgery). We will compare pain, opioid consumption, costs, sedation level, length of hospital stay, patient satisfaction, and complications in patients randomized to receive either pro re nata (PRN) or IVPCA opioids. We hypothesize that IVPCA will be more efficacious than PRN opioids in the treatment of postoperative without an increased incidence of adverse effects.