The 1000th parts of the seconds between subsequent calls of CPUTTIME and CLOCK are correlated:
function sillyTest
a = cputime;
v = rand(1000);
b = cputime;
fprintf('%f %.3f\n%f %f.3\n', a, rem(a*100, 1), b, rem(b*100, 1);
While the 10th and 100th parts of the seconds are independent, the 1000th parts are monotonically increasing (execpt for overflow) - at least in Matlab 2009a. The same problem appears for CLOCK.
Best Answer