There is something called sleep inertia, which is the period where one transitions from sleep to full wakefulness. During this time there is reduced alertness and overall lower performance. Research shows that the period can last up to four hours, and many cognitive tasks such as memory, reaction and ability to do math is impaired. The period can last up to three hours and many cognitive tasks are impaired. The writer of this has only just woken up.