delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/11/06/22:28:41

Date: Sun, 6 Nov 94 18:09:49 -0500
From: dj AT stealth DOT ctron DOT com (DJ Delorie)
To: eliz AT is DOT elta DOT co DOT il
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: clock() problems

> 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 -


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