Earlier quoted context omitted.
I just found a use-case for the sleep( rand(1000) ) function :-)
Nope! If the rand function produces uniform random numbers, then with enough samples the signal comes out ontop the noise. If it is non-uniform, then with enough samples you can determine the non uniformity, and you are at square 1 again. Use proper security instead of obscurity.
What would be a proper first step to harden API for timing attacks?