Mail Archives: djgpp/1994/11/06/22:28:41
> ANSI C says the clock() library function should be prototyped on time.h
> header file. In DJGPP 1.12maint2, it isn't.
For V2.0, a complete overhaul of the includes is underway. Same for the
library.
> Also, the macro CLOCKS_PER_SECOND is 1000000, which means clock()
> returns its results in microseconds. But that means that its
> value (a signed long) will only be wide enough for programs
> which run less than about 40 minutes, right? Is this wise?
You can use time() for periods longer than that with sufficient
resolution, but perhaps a bigger "tic" would be in order. The
alternative is to program clock() to read the microsecond counter in
the interval timer, so it can return actual resolution around a
microsecond?
- Raw text -