From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c6128af70f6d02c8,start X-Google-Attributes: gid103376,public From: Joel VanLaven Subject: Timing things. Date: 1999/06/16 Message-ID: <3767E18A.1904F5AF@acm.org>#1/1 X-Deja-AN: 490331208 Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flash.net X-Trace: news.flash.net 929554853 38.30.238.10 (Wed, 16 Jun 1999 12:40:53 CDT) Organization: FlashNet Communications, http://www.flash.net MIME-Version: 1.0 NNTP-Posting-Date: Wed, 16 Jun 1999 12:40:53 CDT Newsgroups: comp.lang.ada Date: 1999-06-16T00:00:00+00:00 List-Id: 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