From: Neil Smith Date: Sun, 20 Oct 2013 15:42:29 +0000 (+0100) Subject: Added notes on using timeit X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=c50c0b62ecdf5138d6c4b3677aba8035c8481f0c;p=cipher-tools.git Added notes on using timeit --- diff --git a/cipher.py b/cipher.py index 752efed..ebba6d6 100644 --- 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)