comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com
Subject: Re: ADA code execution times
Date: 1998/08/03
Date: 1998-08-03T00:00:00+00:00	[thread overview]
Message-ID: <6q4f6f$vts$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 35c4e297.0@news.pacifier.com

In article <35c4e297.0@news.pacifier.com>,
  "Steve Doiel" <nospam_steved@pacifier.com> 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




  reply	other threads:[~1998-08-03  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-01  0:00 ADA code execution times Brian Franklin
1998-08-01  0:00 ` Tom Moran
1998-08-02  0:00 ` Steve Doiel
1998-08-03  0:00   ` dennison [this message]
1998-08-02  0:00 ` Jerry van Dijk
replies disabled

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