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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!seas.gwu.edu!mfeldman From: mfeldman@seas.gwu.edu (Michael Feldman) Newsgroups: comp.lang.ada Subject: Re: HELP! HELP! HELP! need to display DURATION type Message-ID: <3028@sparko.gwu.edu> Date: 12 Apr 91 01:08:05 GMT References: <1991Apr9.034421.7397@cec1.wustl.edu> Reply-To: mfeldman@seas.gwu.edu () Distribution: na Organization: The George Washington University, Washington D.C. List-Id: 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