I like going to the gym after being awake at least an hour, so that I am fully awake. If I go really late at night I am almost always at least slightly tired, and that does affect my workouts. I get up around 5am, and go at 6am now, and I want to stick to it.