Call the Doctor About Insomnia If: You notice an uncomfortable, painful, "crawling" sensation in your legs when trying to sleep or when your legs are not moving for prolonged periods (such as when driving or on an airplane flight). You notice heartburn that keeps you awake at night.