That can take time, and it can be hard to say "I will only think about this problem from 9-5 today".
I've awoken numerous times in the middle of the night with an "a-ha" feeling and immediately started coding. Does that count?