home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.16 / text0024.txt < prev    next >
Encoding:
Internet Message Format  |  1989-08-11  |  1.9 KB

  1. From: uunet!BRL.MIL!gwyn
  2.  
  3. In article <320@longway.TIC.COM> uunet!mcgrath@paris.Berkeley.EDU@ (Roland McGrath) writes:
  4. >Can anyone tell me why the ANSI C committee changed CLK_TCK to
  5. >CLOCKS_PER_SEC, and how this is supposed to be different than the CLK_TCK
  6. >that 1003.1 assumes the C standard defines?
  7.  
  8. In fact they have totally different uses, and X3J11 had made a serious
  9. mistake when we used the name "CLK_TCK" for the clock()-return conversion
  10. factor.  CLK_TCK was the 1984 /usr/group macro for  converting values
  11. returned by times(), not clock().  1003.1 shuffled back and forth a couple
  12. of times between ttime_t and clock_t as the type of the struct tms members,
  13. settling on clock_t which is defined by ANSI C.  (I think a separate type
  14. would have been better, but we can live with this.)  Then when they saw that
  15. X3J11 had defined CLK_TCK as the appropriate conversion from units of clock_t
  16. to seconds, they naturally assumed it was the same as the 1984 /usr/group
  17. usage.  However, the ANSI C clock() conversion macro was not appropriate for
  18. use with struct tms members.  Last-minute frantic coordination among principal
  19. members of P1003 and X3J11, including the ANSI C draft review subcommittee,
  20. resulted in X3J11 choosing a new name for the ANSI C time-conversion macro;
  21. we considered that a (borderline) "editorial change", since the intention of
  22. the committee was clearly not changed and the use of "CLK_TCK" for clock()
  23. units conversion was purely an X3J11 invention.  This means that the
  24. inheritance of the name "CLK_TCK" from <time.h> that 1003.1 expected doesn't
  25. happen (at least, not in the absence of _POSIX_SOURCE), but that was
  26. considered to be an "easily fixable" matter whereas forcing the same
  27. conversion factor for both times() and clock() would have run counter to
  28. widespread existing practice.
  29.     - D A Gwyn
  30.     acting X3J11/P1003 liaison
  31.  
  32. Volume-Number: Volume 16, Number 22
  33.  
  34.