[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
tic toc
From: |
John W. Eaton |
Subject: |
tic toc |
Date: |
Tue, 5 Jan 2010 02:23:47 -0500 |
On 4-Jan-2010, John Reed wrote:
| Hello,
|
| I've been getting some strange results using tic toc and cputime to get wall
time and cputime for an operation using the find() function.
|
| for example:
|
| tic;
| c=cputime();
|
| ind = find( T(:,1) >= -121.9 & ...
| T(:,1) < -121.8 & ...
| T(:,2) >= 37 & ...
| T_coord_search(:,2) < 37.1 );
|
|
| t=toc;
|
| c=cputime() - c;
|
| fprintf("wall time was %e seconds \n",t);
|
| fprintf("cputime was %e seconds \n",c);
|
| Where T is a 409981 x 2 array of doubles.
|
| sometimes the script returns about 0.016 seconds for both times which seems
reasonable for this operation
|
| on other occasions for the exact same array and conditions the script
returns a wall time of ~ 1e-8 seconds and cputime of 0 seconds which seems
unreasonable (sometimes the wall time is even given as a negative number)
|
| Am I using tic toc and cputime incorrectly?
It looks like you are.
| Or is the time for find to operate really this widely variable? Or could
something be happening peculiar to my system that is causing tic and toc and
cputime to malfunction?
I would not expect negative values for wall clock or CPU time.
It's possible that you've found a bug in Octave, but Octave
is just making system calls to get the values and then returning them
to you, so it seems more likely that those functions are
| Any thoughts or advice someone might have would be greatly appreciated.
What kind of system do you have? Does it have multiple CPUs? What
operating system and version are you using? What C library and
version? etc.
If you think you've found a bug in Octave, then please submit a
complete bug report to the address@hidden list.
Please read http://www.octave.org/bugs.html to see what kind of
information to include so that someone might be able to reproduce and
debug the problem.
jwe
- tic toc, John Reed, 2010/01/04
- tic toc,
John W. Eaton <=