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 X-Google-Attributes: gid103376,public From: tmoran@bix.com (Tom Moran) Subject: Re: Timing things. Date: 1999/06/16 Message-ID: <3767f26f.840466@news.pacbell.net>#1/1 X-Deja-AN: 490363113 References: <3767E18A.1904F5AF@acm.org> X-Complaints-To: abuse@pacbell.net X-Trace: typhoon-sf.snfc21.pbi.net 929559516 207.214.211.175 (Wed, 16 Jun 1999 11:58:36 PDT) Organization: SBC Internet Services NNTP-Posting-Date: Wed, 16 Jun 1999 11:58:36 PDT Newsgroups: comp.lang.ada Date: 1999-06-16T00:00:00+00:00 List-Id: >Windows98 PC using Gnat 3.11p >... >I am getting either end_time and start_time are the same or >num_micros is 110_000 Sounds like it's using the standard PC clock that tickes every 55 milliseconds. You can get a different compiler, or a different OS or machine, or make a direct OS call to QueryPerformanceCounter (sp?) or > start_time := ada.real_time.clock; for trial in 1 .. 100 loop >do operations ( e.g. build 10_000 element heap in at least 23_000 > comparisons) end loop; >end_time := ada.real_time.clock; >num_micros := ada.real_time."/"(ada.real_time."-"(end_time,start_time), ada.real_time.microseconds(1))/100; ie, run the test long enough to get multiple clock ticks, then divide the elapsed time by the number of trials you used.