X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: "A. Sinan Unur" 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: 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 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.