For many people, exercise atleast an hour before going to bed is a great way of having a good night's sleep.

For myself, as long as it's 20+ mins before I lay down, it's wonderful.

Theory behind it would be a release of endorphins caused by strenuous exercise, and then the subsequent crash from the "natural drug" leading to immediate sleep - and then the very deep sleep periods whilst the body is repairing the torn muscle tissues.

I haven't yet graphed my sleep cycles after exercise to confirm or disclaim that theory yet, but I'll add it to the list!