Xref: news2.mv.net comp.os.msdos.djgpp:8038 From: elric AT wheel DOT dcn DOT davis DOT ca DOT us (Jeffrey Taylor) Newsgroups: comp.os.msdos.djgpp Subject: Re: HRTIMER Date: 29 Aug 1996 17:09:52 GMT Organization: Davis Community Network - Davis, California, USA Lines: 36 Message-ID: <504it0$btk@mark.ucdavis.edu> References: NNTP-Posting-Host: wheel.dcn.davis.ca.us To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) wrote: : : On 21 Aug 1996, Sam Phillips wrote: : : > I've been trying to time some code with HRTIMER and everytime it runs the : > program it returns with a 0 for how long the operation took. : : What is HRTIMER? This is the code I use for timing programs. It works fine for me. The resolution is 1/18 of a second. -- ============================================ Without my guitar, I am a poet without arms. - Michael Bloomfield ============================================ #include #include #include int main(int argc, char *argv[]) { int status; clock_t start = clock(); status = spawnvp(P_WAIT, argv[1], argv + 1); fprintf(stderr, "elapsed time: %.2f seconds\n", (float)(clock() - start) / CLK_TCK); return status; }