animation and timing

Ok I want to do something with animation where my guy gradually moves over a certain amount over 1 second.

I’m using glut if that make a difference and I know about glutGet(GLUT_ELAPSED_TIME).

I was just wondering what the best way is of going and doing this. I basically want it so that the keyboard is pressed and calls a move function. This function then operates completely independent of the rest of the main loop. So the main loop continues on and does not wait for the move function to finish.

Any helps or tips would be greatly appreciated. Thanks

position += velocity * elapsed_time