What is the easiest way to run some code each millisecond for a certain amount of time?

Post the code, using code tags.

Answer the question in reply #9.