home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18352 < prev    next >
Encoding:
Internet Message Format  |  1992-12-14  |  1.4 KB

  1. Path: sparky!uunet!pipex!warwick!uknet!comlab.ox.ac.uk!oxuniv!ayoung
  2. From: ayoung@vax.oxford.ac.uk
  3. Newsgroups: comp.lang.c
  4. Subject: Re: High resolution timing?
  5. Message-ID: <1992Dec13.000441.10734@vax.oxford.ac.uk>
  6. Date: 13 Dec 92 00:04:41 GMT
  7. References: <17971@mindlink.bc.ca> <RDORICH.92Nov30220930@jade.tufts.edu>
  8. Organization: Oxford University VAX 6620
  9. Lines: 18
  10.  
  11. In article <RDORICH.92Nov30220930@jade.tufts.edu>, rdorich@jade.tufts.edu (Rob) writes:
  12. > Ok, what you might want is clock().  It will return you the number of
  13. > CPU time (in microseconds) used  since the _FIRST_ clock() in that
  14. > program.  I actually just found about it today :)  I think it's kind
  15. > of a pain that it always gives you the time since the first clock().
  16.  
  17.  Please read the manual again before implementing this bit of advice. The time
  18. returned by clock() is NOT usually in microseconds - my VAX system uses units
  19. of 10 miliseconds, whereas some of my PCs use units of 1/18.2 seconds!  You
  20. need to look up the compiler-specific #definition CLOCKS_PER_SEC which will
  21. tell you the unit that clock() returns.
  22.  
  23. -------------------------------------------------------------------------------
  24.      ___
  25.     /   \   /                 |    /      Alan Young @ uk.ac.ox.vax
  26.    /____/  /  ___    __       |___/
  27.   /    /  /  /   |  /  |         /           "The bigger they are,
  28.  /     \_/\__\__/|_/  /_________/               the harder they fall on you."
  29.