I would basically like to calculate the speed of an object without the
object being a passive rigid body or a particle
querrying out of context halts mayas dg evaluation so while you can do this wit getAttr -t your paying a very very heavy price or doing so. Fine for one object pure death for lots of them. I would stipulate that if you compound thsi with ALL the associated problems most peopel do when they just use expressions, you negate the entire purpose of using maya in the first place.
instead use a expression to store the last frames value. by making a extra container:
$diff=yourObject.oldValueAttr-yourObject.ValueAttr;
yourObject.oldValueAttr=yourObject.ValueAttr;
Yes this does make it a simulation, but thenagain getAttr -t dont amke for a much more meningfull evaluation as you probably use the information in something that cant be used for direct lookup in anyway.