<jupyter_start><jupyter_text>The timit module allows us to time our code in python.<jupyter_code>import timeit
'0-1-2-3-4-5.....99'
timeit.timeit('"-".join(str(n) for n in range(100))', number = 10000)
timeit.timeit('"-".join([str(n) for n in range(100)])', number = 10000)
timeit.timeit('"-".join(map(str,range(100)))', number = 10000)
%timeit "-".join(str(n) for n in range(100))
%timeit "-".join(map(str,range(100)))<jupyter_output>70.5 µs ± 9.81 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
{'fraction_non_alphanumeric': 0.2106299212598425, 'fraction_numerical': 0.0984251968503937, 'mean_word_length': 4.988235294117647, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '664998', 'license': 'Unlicense', 'n_tokens_mistral': 245, 'n_tokens_neox': 204, 'n_words': 54, 'path': '.ipynb_checkpoints/Timing code notes-checkpoint.ipynb', 'repo_name': 'Luzyviento/Class_Notebook', 'size': '508'}