]> granicus.if.org Git - python/commitdiff
Only go into eventloop/interrupt check 10 times per second
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 20 Feb 1997 15:23:18 +0000 (15:23 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 20 Feb 1997 15:23:18 +0000 (15:23 +0000)
Mac/Python/macglue.c

index e2ca49464efa68164dec6aaa2e7feec091d0c8e2..6fc1e99222d0c3dc82ac359e1ce61b751f4dd790 100644 (file)
@@ -351,11 +351,20 @@ scan_event_queue(flush)
        }
 }
 
+#define TICKCOUNT 6
+
 int
 PyOS_InterruptOccurred()
 {
+       static unsigned long nextticktime;
+       unsigned long curticktime;
+
        if (PyMac_DoYieldEnabled < 0)
                return 0;
+       curticktime = (unsigned long)LMGetTicks();
+       if ( curticktime < nextticktime )
+               return 0;
+       nextticktime = curticktime + TICKCOUNT;
 #ifdef THINK_C
        scan_event_queue(1);
 #endif