home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / amiga / programm / 17925 < prev    next >
Encoding:
Internet Message Format  |  1992-12-29  |  3.0 KB

  1. Xref: sparky comp.sys.amiga.programmer:17925 comp.sys.amiga.misc:19201
  2. Newsgroups: comp.sys.amiga.programmer,comp.sys.amiga.misc
  3. Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!chx400!bernina!wild
  4. From: wild@nessie.cs.id.ethz.ch (Markus Wild)
  5. Subject: Re: AmigaDOS vs. ANSI SAS implementation [Was Re: SAS C6.1 datecmp bug]
  6. Message-ID: <1992Dec29.220310.29392@bernina.ethz.ch>
  7. Sender: news@bernina.ethz.ch (USENET News System)
  8. Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
  9. References: <BzEqDF.A5H@unx.sas.com> <DMAK.92Dec25000536@dec5120a.ccs.northeastern.edu> <C01BE5.ALJ@unx.sas.com>
  10. Date: Tue, 29 Dec 1992 22:03:10 GMT
  11. Lines: 42
  12.  
  13. In article <C01BE5.ALJ@unx.sas.com> walker@twix.unx.sas.com (Doug Walker) writes:
  14. >|> Does clock() {ANSI} return a value based on the hardware clock less accurately
  15. >|> than the timer() {AmigaDOS} ignoring their return type differences?
  16. >
  17. >Actually, clock() is an exception.  I implemented clock() myself,
  18. >and it is pretty efficient and does use AmigaDOS calls directly.
  19. >I don't think you could do much better in your own code.
  20.  
  21. Since you mention it.. ;-) Some people bitched at ixemul.library clock(2) not
  22. really measuring real time, so I must assume it's a usual behavior of other
  23. AmigaOS clock(2) implementations to not return the amount of cpu time used by
  24. *the process calling clock*, but just some system dependant flavor of time(2)
  25. with an unknown time base. Is that true? Just as a reminder, this is from the
  26. man page of clock(2):
  27.  
  28. ---------------------------------------------------------------------------
  29. SYNOPSIS                                                                     
  30.      #include <sys/types.h>                                                  
  31.                                                                              
  32.      clock t                                                                 
  33.      clock(void)                                                             
  34.                                                                              
  35. DESCRIPTION                                                                  
  36.      The clock() function determines the amount of processor time used since 
  37.      the invocation of the calling process, measured in CLK_TCKs.            
  38.                                                                              
  39. RETURN VALUES                                                                
  40.      The clock() function returns the amount of time used unless an error oc-
  41.      curs, in which case the return value is -1.
  42. ---------------------------------------------------------------------------
  43.  
  44. So it is clearly a value which is relative to the cpu consumption of
  45. the calling process; a process that just does a 10 second sleep should
  46. return almost no cpu time.
  47.  
  48. Is this what you implemented so efficiently ? ;-)
  49.  
  50. -Markus
  51. -- 
  52. Markus M. Wild    -  wild@nessie.cs.id.ethz.ch  |  wild@amiga.physik.unizh.ch 
  53. Vital papers will demonstrate their vitality by spontaneously moving
  54. from where you left them to where you can't find them.
  55.