TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Proportional Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Tom Moran <[log in to unmask]>
Wed, 15 Nov 2000 14:14:11 PDT
text/plain (13 lines)
>when you compile and run this you will notice that the time for the eighth
>note is way off.  Any ideas as to why this is?
  Measurement error.
  When you start a timing sequence, Next_Time is not the current time,
but rather the time the last "delay until Next_Time" ended.  Since
then you've done various IO etc.  In each section, change the initial pair:
       Time_Start         := Ada.Real_Time.Clock;
       Next_Time       := Next_Time + Delta_xxx_Note;
to
       Time_Start         := Ada.Real_Time.Clock;
       Next_Time       := Time_Start + Delta_xxx_Note;
and the times come out nicely similar.

ATOM RSS1 RSS2