Skip to content

Instantly share code, notes, and snippets.

@indygreg
Created November 25, 2012 00:27
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 indygreg/4141928 to your computer and use it in GitHub Desktop.
Save indygreg/4141928 to your computer and use it in GitHub Desktop.
Logging Benchmarks
#!/usr/bin/python
# Print N integers have M digits.
#
# Usage: print_random_ints.py digit-count count
import random
import sys
digit_count = int(sys.argv[1])
if digit_count == 1:
ints = range(0, 10)
else:
ints = range(10 ** (digit_count - 1), 10 ** digit_count)
for i in range(0, int(sys.argv[2])):
print(random.choice(ints))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment