Clear Filters
Clear Filters

Can Matlab run for more than 100 million years ?

1 view (last 30 days)
SK
SK on 25 Jul 2012
From the matlab documentation for cputime (R2012a):
cputime returns the total CPU time (in seconds) used by your MATLAB application from the time it was started. This number can overflow the internal representation and wrap around.
>> (2^52-1)/(3600*24*365)
ans =
1.428082073620781e+08
t1 = cputime;
pause(5);
t2 = cputime;
display(num2str(t2-t1));
0.0156
tic;
pause(5);
toc;
Elapsed time is 5.000548 seconds.
Am I correct in assuming that cputime measures the cpu time used by the matlab computation, while (tic, toc) measures the total elapsed time (wall time).
Is cputime the time used by the computation only or the entire matlab process? How does one interpret when the computation is performed on multiple processors simultaneously?
I ask because there seems to be some confusion over this in the posts I could find.
Thank you. Regards, Sandeep.

Answers (2)

Star Strider
Star Strider on 26 Jul 2012
With respect to the title of your question, it's functionality you will appreciate if you ever run a large GlobalSearch problem!

Walter Roberson
Walter Roberson on 26 Jul 2012
Remember, display in seconds is different than internal storage in seconds. Some of the high-speed counters roll over every few days.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!