Gloaming is a sleeptimer for iPhone and iPod touch. You set the time by dragging the sun upwards. Then you can watch the sun go down while you are listening to music or an audiobook before you fall asleep. Shaking the iPhone clears the application.
Gloaming is available on the iPhone App Store.