comp.lang.ada
 help / color / mirror / Atom feed
* Timing things.
@ 1999-06-16  0:00 Joel VanLaven
  1999-06-16  0:00 ` Tom Moran
  1999-06-17  0:00 ` Pascal Obry
  0 siblings, 2 replies; 4+ messages in thread
From: Joel VanLaven @ 1999-06-16  0:00 UTC (permalink / raw)


I wrote a program as an assignment for an algorithms class in
Ada95 that builds and operates on a variety of double-ended priority
queues.  I am supposed to time certain operations (the build then the
sum of the subsequent iterations of operations).  I am trying to use
ada.real_time (rather than using some OS feature).  Problem is on my
Windows98 PC using Gnat 3.11p I seem to be getting completely bogus and
useless times. (granularity of at best 1/100 of a second though it looks
more like 1/10 of a second)

So, does anyone know if I have to use a different OS / hardware system,
a different compiler, different code for the timing, or do I need to
modify my problem (least attractive because it was assigned this way).

To do the timing I am using:

start_time := ada.real_time.clock;

do operations ( e.g. build 10_000 element heap in at least 23_000
               comparisons)

end_time := ada.real_time.clock;

num_micros := ada.real_time."/"(ada.real_time."-"(end_time,start_time),
                                      ada.real_time.microseconds(1));


I am getting either end_time and start_time are the same or
num_micros is 110_000

PS. If anyone cares I will be happy to share my code

Thanks,
-- Joel VanLaven




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-06-17  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-16  0:00 Timing things Joel VanLaven
1999-06-16  0:00 ` Tom Moran
1999-06-16  0:00   ` Joel VanLaven
1999-06-17  0:00 ` Pascal Obry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox