comp.lang.ada
 help / color / mirror / Atom feed
From: Joel VanLaven <jvanlaven@acm.org>
Subject: Timing things.
Date: 1999/06/16
Date: 1999-06-16T00:00:00+00:00	[thread overview]
Message-ID: <3767E18A.1904F5AF@acm.org> (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




             reply	other threads:[~1999-06-16  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-16  0:00 Joel VanLaven [this message]
1999-06-16  0:00 ` Timing things Tom Moran
1999-06-16  0:00   ` Joel VanLaven
1999-06-17  0:00 ` Pascal Obry
replies disabled

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