Xref: news-dnh.mv.net comp.os.msdos.djgpp:2685 Newsgroups: comp.os.msdos.djgpp Path: news-dnh.mv.net!mv!news.sprintlink.net!newsfeed.internetmci.com!EU.net!sun4nl!phcoms4.seri.philips.nl!newssvr!kunst From: kunst AT natlab DOT research DOT philips DOT com (Pieter Kunst) Subject: Re: clock() unit ? Sender: news AT natlab DOT research DOT philips DOT com (USENET News System) Organization: Philips Research Laboratories, Eindhoven, The Netherlands References: <19951012170909 DOT olly AT mantis DOT co DOT uk> <19951013163056 DOT olly AT mantis DOT co DOT uk> Date: Mon, 16 Oct 1995 08:50:28 GMT Lines: 32 To: djgpp AT sun DOT soe DOT clarkson DOT edu Dj-Gateway: from newsgroup comp.os.msdos.djgpp In article <19951013163056 DOT olly AT mantis DOT co DOT uk> Olly Betts writes: > >>I *think* that CLOCKS_PER_SEC is an old alternative name for CLK_TCK,so they > >>should be the same if both are defined. I may be wrong though. > > > >No, CLOCKS_PER_SEC is an ANSI C constant, from (See K&R,2nd, p.255). > >clock()/CLOCKS_PER_SEC returns the processor time used by the program, > >in seconds, since the beginning of execution. > > > >CLK_TCK is PC only. You'd better avoid using it. > > We've a draft of the ANSI standard here (October 31, 1988) which says > CLK_TCK is what you divide clock() by, though it's quite possible they > changed it in the issued version of the standard (which I don't have access > to currently). > > It's not as simple as "CLK_TCK is PC only" though. max AT alcyone DOT darkside DOT com (Erik Max Francis) writes: > > It's not as simple as "CLK_TCK is PC only" though. > My copy of the ANSI C 1990 standard doesn't even mention CLK_TCK. Perhaps we'd better take the upcoming ANSI C++ standard as a reference ?!? You can browse through the 'April Working Paper' of the ANSI C++ standard at: http://www.cygnus.com/~mrs/wp-draft/index.html Here you'll find references to CLOCKS_PER_SEC in section 18.7, Table 5 [lib.support.runtime] and in annex C.4, Table 1 [diff.library]. CLK_TCK is not mentioned in this paper. Pieter.