From: Jack Jansen Date: Thu, 20 Feb 1997 15:23:18 +0000 (+0000) Subject: Only go into eventloop/interrupt check 10 times per second X-Git-Tag: v1.5a1~334 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7e9440408127990b796c4a325cc0c0ee27a1fe5e;p=thirdparty%2FPython%2Fcpython.git Only go into eventloop/interrupt check 10 times per second --- diff --git a/Mac/Python/macglue.c b/Mac/Python/macglue.c index e2ca49464efa..6fc1e99222d0 100644 --- a/Mac/Python/macglue.c +++ b/Mac/Python/macglue.c @@ -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