delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/03/11/10:45:06

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: "A. Sinan Unur" <asu1 AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: timing routines (repost)...
Date: 11 Mar 2002 15:43:51 GMT
Organization: Cornell University
Lines: 31
Sender: asu1 AT cornell DOT invalid (on 128.253.251.212)
Message-ID: <Xns91CE6D279DE0Aasu1cornelledu@132.236.56.8>
References: <20020311142313 DOT 11973 DOT qmail AT mellon DOT com>
NNTP-Posting-Host: 128.253.251.212
X-Trace: news01.cit.cornell.edu 1015861431 925 128.253.251.212 (11 Mar 2002 15:43:51 GMT)
X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu
NNTP-Posting-Date: 11 Mar 2002 15:43:51 GMT
User-Agent: Xnews/L5
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Brozewicz Robert F <brozewicz DOT rf AT mellon DOT com> wrote in
news:20020311142313 DOT 11973 DOT qmail AT mellon DOT com: 

> im not sure if this made it to the list seeing i received a few
> responses that i had my e-mail in html format instead of text format.
> so im posing it again.

I don't understand this. Three people responded to your post, and you 
responded to Eli's, so you must know your post made it here.

> can someone please share with me a 'c' routine that can be used to
> display how long a program executes in hours/minutes/second and down
> to the lowest time possible.  
>  
> i want to be able to time how long a program runs.

depends on what your purpose is. if you are trying to collect data for 
optimization, then you should look into 'profiling' (using gprof).

if all you want is a simple uptime function, then you can use time, clock, 
uclock and assorted friends. note that the more resolution you want, the 
more you are going to run in to problems with counters wrapping, especially 
if your program is supposed to run for more than a day.

on the other hand, one of the simplest solutions is to invoke your program 
with redir -t myprog.exe

it is hard to recommend a specific method without knowing why you need 
this.

Sinan.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019