<commit_before><commit_msg>Create TimeTests.js<commit_after>// --------------------------------------------------------------------------------------------------------------- //
/*   ------------------------------------https://learn.javascript.ru/decorators----------------------------------*

   _____ ____  _____  ______   _    _ ______ _____  ______ 
  / ____/ __ \|  __ \|  ____| | |  | |  ____|  __ \|  ____|
 | |   | |  | | |  | | |__    | |__| | |__  | |__) | |__   
 | |   | |  | | |  | |  __|   |  __  |  __| |  _  /|  __|  
 | |___| |__| | |__| | |____  | |  | | |____| | \ \| |____ 
  \_____\____/|_____/|______| |_|  |_|______|_|  \_\______|
                                                                                                                     
*/
// --------------------------------------------------------------------------------------------------------------- //
var timers = {};

// adds time f inti timers[timer]
function timingDecorator(f, timer) {
  return function() {
    var start = new Date();

    var result = f.apply(this, arguments); // (*)

    if (!timers[timer]) timers[timer] = 0;
    timers[timer] += new Date() - start;

    return result;
  }
}

{'fraction_non_alphanumeric': 0.38274706867671693, 'fraction_numerical': 0.0008375209380234506, 'mean_word_length': 0.7889221556886228, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '560479', 'n_tokens_mistral': 342, 'n_tokens_neox': 323, 'n_words': 33}