TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
From: Tom Moran <[log in to unmask]>
Date: Wed, 15 Nov 2000 14:14:11 PDT
Reply-To: Tom Moran <[log in to unmask]>
Parts/Attachments: 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;
       Time_Start         := Ada.Real_Time.Clock;
       Next_Time       := Time_Start + Delta_xxx_Note;
and the times come out nicely similar.