Skip to content

Instantly share code, notes, and snippets.

@borntyping
Created March 6, 2014 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borntyping/9387599 to your computer and use it in GitHub Desktop.
Save borntyping/9387599 to your computer and use it in GitHub Desktop.
for i in range(10):
print(i)
❯ ~ (sam@mogget)
❯ time python ~/dev/while.py
1
2
3
4
5
6
7
8
9
10
python ~/dev/while.py 0.01s user 0.00s system 88% cpu 0.010 total
❯ ~ (sam@mogget)
❯ time python ~/dev/generator.py
0
1
2
3
4
5
6
7
8
9
python ~/dev/generator.py 0.00s user 0.00s system 96% cpu 0.010 total
i = 0
while i < 10:
i += 1
print(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment