It seems like cputime does not work as advertised on Mac OSX 10.11.6 and Matlab 2016b or Windows 7 Matlab 2016a. cputime should be in seconds, but running this command, then waiting for many seconds, and then running it again. Here's some example code, comparing it to tic/toc. The numbers aren't even close …
t1 = tic; t2 = cputime; pause(5); t3 = cputime-t2; t4 = toc(t1); disp(t3); disp(t4);
I don't use cputime() normally, but I was exploring another issue with a mismatch between tic/toc and some internally timed c code (will post as another issue) and I wanted to see how cputime compared.
Best Answer