Re: Real Time IO routines



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

Something seems to be wrong though. In my program I am basiclly
doing:

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?

The RM says that "Time" is supposed to be able to represent a value,
from program start, of at least 50 years. So if a 10-second program
is overflowing that time, you've got a problem.

I tried a program similar to the above on two different compilers,
with "delay 10.0" in the place where you have "I run my algorithm
here"; and in both cases the output is around 10.0. I don't know why
you'd be seeing zero, assuming the system you're on has a working
clock. What type of machine are you running on, and what compiler?

-- Adam


.



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: A puzzle
    ... > I should rectify that. ... I can't agree that time is a clock, ... and velocity which are very real, and when we plow those those an algorithm, ...
    (sci.physics.relativity)