]> granicus.if.org Git - python/commitdiff
Finally *tested* effect of fg and bg yield values (and changed them:-)
authorJack Jansen <jack.jansen@cwi.nl>
Sun, 22 Sep 1996 22:15:20 +0000 (22:15 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Sun, 22 Sep 1996 22:15:20 +0000 (22:15 +0000)
Mac/Lib/test/fgbgtimetest.py [new file with mode: 0644]

diff --git a/Mac/Lib/test/fgbgtimetest.py b/Mac/Lib/test/fgbgtimetest.py
new file mode 100644 (file)
index 0000000..fd2b649
--- /dev/null
@@ -0,0 +1,17 @@
+"""fgbgtest - See how many CPU cycles we get"""
+
+import time
+
+loopct = 0L
+oldloopct = 0L
+oldt = time.time()
+
+while 1:
+       t = time.time()
+       if t - oldt >= 1:
+               if oldloopct:
+                       print loopct-oldloopct,'in one second'
+               oldloopct = loopct
+               oldt = time.time()
+       loopct = loopct + 1
+