The importance of sleep for cognition in young adults is well established, but the role of habitual sleep behavior in cognition across the adult life span remains unknown. We examined the relationship between sleep continuity and total sleep time as assessed with a sleep-detection device, and cognitive performance using a battery of tasks in young (n= 59, mean age= 23.05) and older (n= 53, mean age= 62.68) adults. Across age groups, higher sleep continuity was associated with better cognitive performance. In the younger group, higher sleep continuity was associated with better working memory and inhibitory control. In the older group, higher sleep continuity was associated with better inhibitory control, memory recall, and verbal fluency. Very short and very long total sleep time was associated with poorer working memory and verbal fluency, specifically in the younger group. Total sleep time was not associated with cognitive performance in any domains for the older group. These findings reveal that sleep continuity is important for executive function in both young and older adults, but total sleep time may be more important for cognition in young adults.(PsycInfo Database Record (c) 2020 APA, all rights reserved)