comp.lang.ada
 help / color / mirror / Atom feed
From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: HELP! HELP! HELP! need to display DURATION type
Date: 12 Apr 91 01:08:05 GMT	[thread overview]
Message-ID: <3028@sparko.gwu.edu> (raw)
In-Reply-To: 1991Apr9.034421.7397@cec1.wustl.edu

In article <1991Apr9.034421.7397@cec1.wustl.edu> llb4901@cec2.wustl.edu (Lonnie Lee Blackwood) writes:
>We are doing a timing analysis on our Ada program and need to display
>the # seconds elapsed, which is type DURATION.
>
>DURATION is larger than an integer, so it can't be PUT in the same way.
>
>Any help would be appreciated!

How about putting the following in your program library:

WITH Text_IO;
PACKAGE Duration_IO IS NEW Text_IO.Fixed_IO(Num=>Duration);

in subsequent programs, just "with" Duration_IO. Since Duration is
just a fixed-point type, this will work fine (I've done it before).

Keep the following in mind: if your program is running on a timesharing
system, Calendar gives REAL TIME (WALLCLOCK), not the CPU time used
by your program. (On a PC, since you're the only user, the two times
are equivalent)

I can post a Unix-oriented CPU timing package that interfaces to C,
to get CPU time from Unix timing services. Anyone interested?

Mike Feldman

      parent reply	other threads:[~1991-04-12  1:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-04-09  3:44 HELP! HELP! HELP! need to display DURATION type Lonnie Lee Blackwood
1991-04-12  0:19 ` Bob Kitzberger @sation
1991-04-12  1:08 ` Michael Feldman [this message]
replies disabled

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