Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d1069e

Browse files
committed
Finally *tested* effect of fg and bg yield values (and changed them:-)
1 parent d617c57 commit 0d1069e

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Mac/Lib/test/fgbgtimetest.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""fgbgtest - See how many CPU cycles we get"""
2+
3+
import time
4+
5+
loopct = 0L
6+
oldloopct = 0L
7+
oldt = time.time()
8+
9+
while 1:
10+
t = time.time()
11+
if t - oldt >= 1:
12+
if oldloopct:
13+
print loopct-oldloopct,'in one second'
14+
oldloopct = loopct
15+
oldt = time.time()
16+
loopct = loopct + 1
17+

0 commit comments

Comments
 (0)