<commit_before># Bench

## Purpose

A light-weight class for quickly benchmarking/timing/profiling PHP code.

## Basic Usage

    /**
     * Start & Stop
     */
     include 'class.Bench.php';
     Bench::start();
     // [Some Code To Test]
     echo Bench::stop() . ' Seconds'; -> 2.13274598122
    
    
    /**
     * Marks
     */
     include 'class.Bench.php';
     Bench::start();
     // [Application Bootstrap]
     Bench::mark('bootstrap');
     // [Database Connection Opened]
     Bench::mark('database');
     // [Data Processing + Manipulation]
     Bench::mark('processing');
     // [HTML Creation]
     Bench::mark('html');
     // [MISC]
     Bench::stop();
          
     // Get data on specific mark.
     print_r(Bench::getMarkById('database')); // ->
        Array (
             // The mark id.
             [id] => database
             // The microtime(true) of when this mark occurred.
             [microtime] => 1287969552.88
             // The time (in seconds) since start() was called.
             [since_start] => 1.10582304001
             // The time since the last mark [or] since start(), if first call to mark().
             [since_last_mark] => 0.171210050583
         )
     
     // Get statistics
     print_r(Bench::getStats()); // ->
         Array (
             // The average time between marks (in seconds)
             [mark_average] => 0.346896330516
             // The longest mark
             [mark_longest] => Array
                 (
                     [id] => database
                     [microtime] => 1288045989.62
                     [since_start] => 1.02174592018
                     [since_last_mark] => 0.831446886063
                 )
             // The shortest mark
             [mark_shortest] => Array
                 (
                     [id] => processing
                     [microtime] => 1288045989.64
                     [since_start] => 1.04068899155
                     [since_last_mark] => 0.0189430713654
                 )
             // Start microtime
             [start] => 1288060408.82
             // Stop microtime (if called)
             [stop] => 1288060409.95             
             // Time elapsed (in seconds)
             [elapsed] => 1.0407409668
         )
  
More examples available at http://github.com/veloper/Bench/wiki

## Website

http://dan.doezema.com/2010/10/bench-php-class/

## License

DDWinUCache is released under the New BSD license.
http://dan.doezema.com/licenses/new-bsd/<commit_msg>Fixed README Typo.<commit_after># Bench

## Purpose

A light-weight class for quickly benchmarking/timing/profiling PHP code.

## Basic Usage

    /**
     * Start & Stop
     */
     include 'class.Bench.php';
     Bench::start();
     // [Some Code To Test]
     echo Bench::stop() . ' Seconds'; -> 2.13274598122
    
    
    /**
     * Marks
     */
     include 'class.Bench.php';
     Bench::start();
     // [Application Bootstrap]
     Bench::mark('bootstrap');
     // [Database Connection Opened]
     Bench::mark('database');
     // [Data Processing + Manipulation]
     Bench::mark('processing');
     // [HTML Creation]
     Bench::mark('html');
     // [MISC]
     Bench::stop();
          
     // Get data on specific mark.
     print_r(Bench::getMarkById('database')); // ->
        Array (
             // The mark id.
             [id] => database
             // The microtime(true) of when this mark occurred.
             [microtime] => 1287969552.88
             // The time (in seconds) since start() was called.
             [since_start] => 1.10582304001
             // The time since the last mark [or] since start(), if first call to mark().
             [since_last_mark] => 0.171210050583
         )
     
     // Get statistics
     print_r(Bench::getStats()); // ->
         Array (
             // The average time between marks (in seconds)
             [mark_average] => 0.346896330516
             // The longest mark
             [mark_longest] => Array
                 (
                     [id] => database
                     [microtime] => 1288045989.62
                     [since_start] => 1.02174592018
                     [since_last_mark] => 0.831446886063
                 )
             // The shortest mark
             [mark_shortest] => Array
                 (
                     [id] => processing
                     [microtime] => 1288045989.64
                     [since_start] => 1.04068899155
                     [since_last_mark] => 0.0189430713654
                 )
             // Start microtime
             [start] => 1288060408.82
             // Stop microtime (if called)
             [stop] => 1288060409.95             
             // Time elapsed (in seconds)
             [elapsed] => 1.0407409668
         )
  
More examples available at http://github.com/veloper/Bench/wiki

## Website

http://dan.doezema.com/2010/10/bench-php-class/

## License

Bench is released under the New BSD license.
http://dan.doezema.com/licenses/new-bsd/
{'fraction_non_alphanumeric': 0.12363564199245883, 'fraction_numerical': 0.07064893828140505, 'mean_word_length': 1.4254090471607315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 45, '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}}
{'dir': 'git-commits-cleaned', 'id': '6824936', 'n_tokens_mistral': 1693, 'n_tokens_neox': 1410, 'n_words': 331}