How do I set up a loop using Gettickcount to do an animation for a certain amount of time, say for 2 seconds?

Thanks