Added notes on using timeit
authorNeil Smith <neil.github@njae.me.uk>
Sun, 20 Oct 2013 15:42:29 +0000 (16:42 +0100)
committerNeil Smith <neil.github@njae.me.uk>
Sun, 20 Oct 2013 15:42:29 +0000 (16:42 +0100)
cipher.py

index 752efed3582c9caba29f2bb7db35b36c1d38dbd2..ebba6d622c5c182b604dcef27fe92aa34565667c 100644 (file)
--- a/cipher.py
+++ b/cipher.py
@@ -4,6 +4,13 @@ import norms
 import logging
 from segment import segment
 
+# To time a run:
+#
+# import timeit
+# c5a = open('2012/5a.ciphertext', 'r').read()
+# timeit.timeit('keyword_break(c5a)', setup='gc.enable() ; from __main__ import c5a ; from cipher import keyword_break', number=1)
+
+
 logger = logging.getLogger(__name__)
 logger.addHandler(logging.FileHandler('cipher.log'))
 logger.setLevel(logging.WARNING)