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