Inclusion Criteria:  Age ≥ 65 years but < 90 years; Scheduled to undergo hip fracture surgery; Planned to use patient-controlled intravenous analgesia (PCIA) after surgery.  Exclusion Criteria:  Refuse to participate in this study; Preoperative history of schizophrenia, epilepsy, Parkinsonism, or myasthenia gravis; Inability to communicate in the preoperative period because of coma, profound dementia or language barrier; Preoperative obstructive sleep apnea (diagnosed sleep apnea syndrome or a STOP-Bang score ≥3 combined with a serum bicarbonate ≥28 mmol/L); Sick sinus syndrome, severe sinus bradycardia (< 50 beats per minute), or second-degree or above atrioventricular block without pacemaker; Severe hepatic dysfunction (Child-Pugh class C); Severe renal dysfunction (requirement of renal replacement therapy before surgery); American Society of Anesthesiologists physical status >IV, or estimated survival ≤24 h.