octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #54695] toc before tic


From: Rik
Subject: [Octave-bug-tracker] [bug #54695] toc before tic
Date: Mon, 24 Sep 2018 12:06:33 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0

Update of bug #54695 (project octave):

                Priority:              5 - Normal => 3 - Low                

    _______________________________________________________

Follow-up Comment #7:

I also think it is probably more useful for novice to intermediate programmers
to receive an error about a possibly bogus construct, rather than to: 1)
return 0 (which means something) or NaN (better, because it at least says that
this timing value is invalid).

There are multiple workarounds.  The easiest is just to re-structure the
timing code rather than putting it on one line.  I write my benchmarks with
bracketing tic/toc statements on separate lines and it seems clear enough.


N = 10;  # number of iterations
bm = zeros (N, 1);  # timing benchmarks
for i = 1:10
  tic;

  ## code to test here ##

  bm(i) = toc;
endfor




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?54695>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]