Path: utzoo!utgpu!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!chianti!shane From: shane@chianti.cc.umich.edu (Shane Looker) Newsgroups: comp.sys.mac.programmer Subject: Re: A few questions about Ticks Message-ID: <590@mailrus.cc.umich.edu> Date: 27 Jul 88 14:15:37 GMT References: <3417@polya.Stanford.EDU> Sender: usenet@mailrus.cc.umich.edu Reply-To: shane@um.cc.umich.edu (Shane Looker) Organization: University of Michigan Computing Center, Ann Arbor Lines: 42 In article <3417@polya.Stanford.EDU> rothberg@polya.Stanford.EDU (Edward Rothberg) writes: >I've been playing around with time dependent stuff a bit recently, and I >can't seem to find the answers to the following questions: > >1) It's made clear that Ticks will be updated whether there's time to > do any VBL tasks or not. What I'm wondering is, if I put > something in the queue with a vblCount of say 60, and in > the interval between then and 60 ticks later, it's only able to > do VBL tasks 30 times (a gross exageration for example's sake), > will my VBL task still be executed after 60 ticks, or will it > be executed after 60 + the lost 30? i.e. is decrementing the > vblCount of all VBL tasks something that is always done, or only > something that's done if there's time? How crucial is it that this run every N ticks? If this is all inside an application you are writing, you might want to use the Time Manager. It gives a more accurate way of executing a time dependant task. Make sure you RmvTime on each task you install. I crash when I exit if I don't. My understanding (possibly wrong), is that the Vertical Retrace executes every 60th of a second. Updates of the vblCount fields is done then. VBl Tasks MAY not get run if the CPU is busy with something else right then, which primarily means disk access. The vblCount may not be be updated in the same situation. >2) Why use the TickCount() trap when the Global variable Ticks is available? > Is it in Apple's list of > "targeted" low-memory globals, globals that Apple says will have to > go in the future? Not all languages have access to low memory globals. It is safer anyway. What if Apple decides that the Mac IIe needs to have the globals shifted to another section of memory? Or they would fit better or look more aesthetic if layed out differently? I don't think they will, but TickCount() is the standard way to find out the information. >Ed Rothberg >rothberg@polya.stanford.edu Shane Looker Looker@um.cc.umich.edu