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,a889ad4a86a5caa4 X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: ADA code execution times Date: 1998/08/03 Message-ID: <6q4f6f$vts$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 377475790 References: <35c354e5.140587456@news.gatech.edu> <35c4e297.0@news.pacifier.com> Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Mon Aug 03 13:50:06 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.0; Windows NT; Gateway2000) Date: 1998-08-03T00:00:00+00:00 List-Id: In article <35c4e297.0@news.pacifier.com>, "Steve Doiel" wrote: > > Brian Franklin wrote in message <35c354e5.140587456@news.gatech.edu>... > >I asked this question before and received some replies which were of > >some use but no answers. So I'll ask again... > > > >What code can I use in my ADA program to report the time. I want to > >get an estimate of the execution time. Getting the CPU time seems > >somewhat complicated so I'll settle for getting the time at the start > >and finish of the process in order to get an estimate of the > >performance of the code. > > Here is some code I used to compare the time of using a task versus a > protected type to implement a semaphore. My basic technique is to capture > the time before performing the thing I want to time, perform the operation > multiple times, and then capture the time at the end . You have to be somewhat careful about that approach in general though. An optimizer is quite likely to find operations that it can pull outside of the loop and perform only once. An aggressive optimizer might even notice that the result won't change, and optimize the entire loop down to one iteration! T.E.D. -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum