http://www.cs.rice.edu/~dwallach/pub/crosby-timing2009.pdf
Adding jitter will not defeat timing attacks unless the jitter is dependent on the input, like blinded RSA.
You keep track of the time while doing the comparison, then before spitting back the result you feed the amount of time to a separate function that will sleep (or whatever) a certain amount of predetermined time so that all results process in the same time.
I realize this is a bit excessive, and will slow down your code quite a bit, but if you are really that worried about this type of attack, why not?
(In some languages—hi Ruby!—you might not even have access to reliable millisecond-resolution timing.)
The downside is that while the solution given in the OP will use a constant amount of time, that constant amount of time itself is not fixed. When over the years processors get faster, the code can execute faster, but in the above case it cannot.
Sure it can. You can drop the limit whenever you change processors. In fact, you can tune the limit for a given call to be the max time taken by that call. As the implementation or resources change, the limit changes.