site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=s+s4BJ3W6d3gA/SrdDXbUorzOH3PYc0hJxAs7zskGHs=; b=FYg1w8zvruWRBsi6/scyGZ76FAbxEU0j5Phfo8kxpkRMyG3VoUD4LBQq+mLRUp0KeI PdM8+Hs9xtGogwsoTyFPbW40Vzo/Euwj29x9h/wJi9K9r6iZXiS15sgzehhc16/eXKVz ieqR80ASJtuAocuRjl1p01x6O2x348FGCeuTs= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=Tq1ZjNwAU4cd1CL4fY9uFCeJv7vbR+eRXS1gs2NUXrVMsPdXA21JDusqfr1HvSTlLC jgMoNtwNRc2p05jffRwK69FweZycoL6mTXomAmb+L/2DLWb1fn/w3TIptjUJiFpdpQtx tXgbzzrVoqE81eqaoZoDlg3txleJfTbmxA1CI= On Jan 30, 2009, at 16:01 , Andy Wiese wrote: On Jan 30, 2009, at 9:05 AM, Jason Coco wrote: On Jan 30, 2009, at 09:27 , Christopher Khaljah Xu wrote: Hi there! I'm a rookie on a mac. I've been trying to port some windows programs that was written in C/C++ onto the mac. I need to rewrite a timer that measures CPU ticks between the start and end of an operation. I wonder if there is something in the mac api similar as GetTickCount or GetTickCount64 ? You can use mach_absolute_time() (declared in mach/mach_time.h) for this purpose. For more information on using this routine, see this technical qa: http://developer.apple.com/qa/qa2004/qa1398.html Jason How does clock(3) compare to mach_absolute_time()? mach_absolute_time() actually counts the clock cycles and is the reference timer for everything else. Internally, from the C library, clock(3) calls getrusage(2) on itself and returns the converted sum of its system and user time. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jason Coco