Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!ncar!boulder!spot!spaid From: spaid@spot.Colorado.EDU (SPAID RICHARD) Newsgroups: comp.sys.mac.programmer Subject: Time Manager -- please help! Message-ID: <5363@boulder.Colorado.EDU> Date: 16 Dec 88 01:17:47 GMT Sender: news@boulder.Colorado.EDU Reply-To: spaid@spot.Colorado.EDU (SPAID RICHARD) Organization: University of Colorado, Boulder Lines: 65 [ I just discovered this group, so forgive me if this is old hat. ] Has anyone out there used the Time Manager much? I've tried to use it, under both LSP and LSC (v3 of the latter), and had very little luck. Here's my latest attempt: /* example of Time Manager tasks Adapted from example in Tech Note #180 */ #include #include #define Interval 1000L /* one second interval */ int Counter; /* glob. var. that the timed task will access */ EventRecord MyEvent; TMTask myTimeTask; pascal void DoTT() /* the task installed as a Time Manger task -- just increments Counter and returns */ { SetUpA5(); /* need to do this in interrupt service routines */ Counter++; PrimeTime(&myTimeTask, Interval); /* make it happen over and over */ RestoreA5(); } main() { printf("Time Manager tester\n"); Counter = 0; myTimeTask.tmAddr = (ProcPtr) DoTT; /* set up the TMTask record */ InsTime(&myTimeTask); /* install it */ PrimeTime(&myTimeTask, Interval); /* start it */ do { printf("%d\n", Counter); } while (!GetNextEvent(mDownMask,&MyEvent)); /* go until a mouse click */ RmvTime(&myTimeTask); /* get rid of it */ } Simple stuff, eh? Should just print a bunch of numbers that increment every second, right? Well, it doesn't work. Sometimes it will count up to three, and then keep printing threes for ever, sometimes it will get up to five or six. It seems as if the task just doesn't get re-Primed after a few times. Also LSC beeps twice after I close the parting message that stdio puts up -- what is it trying to tell me? If anyone can tell me what I'm doing wrong, I would be VERY appreciative. I need the Time Manager for both a project at work and projects at home, and it's been a source of frustration for me for a long time. Thanks in advance for any and all suggestions or comments. (Novice in netland -- hence no signature)