Finding speed of node

What would be the best way to find out how fast a node is moving?

I need to do this so I can set the animation speed of a model based upon how fast it is moving. Since I am using a physics engine on a hilly terrain, when the model goes up hill it is moves much slower, and I would like to set the animation speed based on this.

On each frame record position of node and just calculate difference, thats your distance, and there is command that returns time between current and last frame.
And than its just distance/time.