This also happens to me mostly when am having a deadline I find it difficult to sleep, i struggle to make sure i finish whatever it is that am doing before closing my eyes to rest. I keep awake and stay motivated by the accomplishment that comes after working.