Re: Real Time IO routines



On Oct 26, 4:14 pm, andrew <andrew.carr...@xxxxxxxxxxx> wrote:


start := clock;
--I run my algorithm here
finish := clock;
ada.Text_IO.put_line("time = " & duration'image(to_duration(finish -
start)));

the output is always time = 0.000000000. I know it had to take some
time because it takes about 10 seconds for the program to reach that
point in the code. Overflow maybe?

For years I used the identical logic in an exercise in plotting
running times for various sorting algortihms in a unit on Big-O. It
worked fine for the old GNAT (Ada 95). Last year when I recompiled it
with GNAT GPL, I got the same results as you - all times gave zero.
When I added a delay 10.0, it worked as Adam reported. I meant to
submit a bug report, but never got around to writing it up. I haven't
tried it with the latest GPL version.

John


.



Relevant Pages

  • Re: SpaceTime & memory.
    ... Each atom is in its self is a tiny clock, ... I've thought about if the preception of time ... Artificial Intelligence program. ... Perhaps if such an algorithm could be discovered, ...
    (sci.physics.relativity)
  • Re: polling algorithm
    ... what can the third insane clock say that will make you think ... server claims its own accuracy is. ... > It is possible that a naive algorithm could be mislead. ... way to determine whether it is a falseticker. ...
    (comp.protocols.time.ntp)
  • Re: question on timing results
    ... clock() provides the ... >> call to an algorithm and the end would provide me with the CPU time ... > The bash commando 'time' gives real, user and system time of a command. ...
    (Fedora)
  • Re: 64 bit atomic reads on x86
    ... By explaining that it only works for a clock. ... You have to detect roll-over ... general-purpose algorithm. ... I think the true problem with his algorithm. ...
    (comp.programming.threads)
  • Re: 10 rules for benchmarking (was Re: Teaching new tricks to an old dog (C++ -->Ada))
    ... I can't believe that the Ada ... >>that they wouldn't put a performance measuring routine in the core ... How about the ANSI C solution: clock() must be defined, ...
    (comp.lang.ada)