An electroencephalography (EEG) test may be performed for the diagnosis of sleep disorders. For this procedure, a period of 6 to 8 hours of sleep deprivation is typically recommended to allow for clearer observation of electrical activity in the brain and to facilitate the patient falling asleep during the test. This approach enables more accurate detection of sleep-related abnormalities.