<commit_before>Overview
--------

A collection of scripts to demonstrate very easy ways to benchmark code or time execution.  These scripts are presented as a starting off point to get you thinking about performance and measurement.

Example 1
---------

This example demonstrates the use of the `time` utility as found on most Unix like personal computers (may not be available on Windows).  For more information on how to use the command, consult the man file with `man time`.

Usage:

    $ time python 1-example.py 10000


Example 2
---------

This example script provides the most straightforward method to provide the elapsed time for a piece of code.

Usage:

    $ python 2-example.py 10000

Example 3
---------

This example script uses a slightly more sophisticated method for timing a block of code through the use of Python context managers.  For more information on context managers and the "with" statement consult [PEP 343](https://www.python.org/dev/peps/pep-0343/).
<commit_msg>adds link to real/user/sys explanation<commit_after>Overview
--------

A collection of scripts to demonstrate very easy ways to benchmark code or time execution.  These scripts are presented as a starting off point to get you thinking about performance and measurement.

Example 1
---------

This example demonstrates the use of the `time` utility as found on most Unix like personal computers (may not be available on Windows).  For more information on how to use the command, consult the man file with `man time`.

For a quick explanation of real, user, and sys values please review [this](http://stackoverflow.com/questions/556405/what-do-real-user-and-sys-mean-in-the-output-of-time1#556411) Stack Overflow answer.

Usage:

    $ time python 1-example.py 10000


Example 2
---------

This example script provides the most straightforward method to provide the elapsed time for a piece of code.

Usage:

    $ python 2-example.py 10000

Example 3
---------

This example script uses a slightly more sophisticated method for timing a block of code through the use of Python context managers.  For more information on context managers and the "with" statement consult [PEP 343](https://www.python.org/dev/peps/pep-0343/).

{'fraction_non_alphanumeric': 0.0811541929666366, 'fraction_numerical': 0.02569882777276826, 'mean_word_length': 3.5285714285714285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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}}
{'dir': 'git-commits-cleaned', 'id': '545728', 'n_tokens_mistral': 599, 'n_tokens_neox': 534, 'n_words': 300}