Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!apple.com!rmh From: rmh@apple.com (Rick Holzgrafe) Newsgroups: comp.sys.mac.programmer Subject: Re: Animation Message-ID: <12151@goofy.Apple.COM> Date: 18 Feb 91 22:50:08 GMT Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 38 References:<1961.27B4BFB4@stjhmc.fidonet.org> <145515@tiger.oxy.edu> In article <145515@tiger.oxy.edu> schorsch@oxy.edu (Brent William Schorsch) writes: > Baudoin Raoult writes in a message to All > > tmp := TickCount; while tmp=Tickcount do { nothing } ; CopyBits(.....) > > Lawson English says: > >To make sure that you get the most accurate reading (and the longest time i > which to do your drawing) use GetTrapAddress to bypass the Trap Dispatcher a > jump directly to TickCount. Otherwise, you have 100+ CPU cycles of overhead > > if you're going to go against guideline, why not use the global variable > Ticks. (unless you're running under A/UX)... > This seems safer to me.. (not to metion faster) > -Brent It's not safer - and you yourself just gave one reason why: it won't run under A/UX. This is a portent of the future: not that A/UX will take over, but that low-memory globals will not be supported forever. GetTrapAddress may not work forever either (we are recommending against its use, as Brent implies) but directly accessing some low-memory globals is already broken in some environments, while GetTrapAddress at least still works. If you *must* bypass the trap mechanism, GetTrapAddress is safer than accessing Ticks directly. (BTW - in most environments, it's also nearly as fast. TickCount is a very short, fast routine, if you avoid the trap overhead.) ========================================================================== Rick Holzgrafe | {sun,voder,nsc,mtxinu,dual}!apple!rmh Software Engineer | AppleLink HOLZGRAFE1 rmh@apple.com Apple Computer, Inc. | "All opinions expressed are mine, and do 20525 Mariani Ave. MS: 3-PK | not necessarily represent those of my Cupertino, CA 95014 | employer, Apple Computer Inc."