<commit_before>#include <time.h>

clock_t calc_time0,calc_time1;
double calc_time;
#define TIME_ON  calc_time0=clock();
#define TIME_OFF(msg) calc_time1=clock();                    \
  calc_time=(double)(calc_time1-calc_time0)/CLOCKS_PER_SEC;  \
  std::cout<<msg<<": iterations="<<i                          \
      <<" CPU Time="<<std::fixed<<calc_time                              \
      <<" iter/s="<<i/calc_time<<std::endl<<std::flush;
<commit_msg>Print times in fixed columns.<commit_after>#include <time.h>
#include <sstream>
#include <iostream>

clock_t calc_time0,calc_time1;
double calc_time;

void printTime(const std::string& msg, long long iterations, double iterPerSec) {
    std::stringstream ss;
    ss << msg;
    while (ss.tellp() < 30) {
        ss << ' ';
    }
    ss << " iterations=" << iterations;
    while (ss.tellp() < 60) {
        ss << ' ';
    }
    ss <<" CPU Time="<<std::fixed<<calc_time;
    while (ss.tellp() < 80) {
        ss << ' ';
    }
    ss <<" iter/s="<<iterPerSec<<std::endl;
    std::cout << ss.str() << std::flush;
}


#define TIME_ON  calc_time0=clock();
#define TIME_OFF(msg) calc_time1=clock();                    \
  calc_time=(double)(calc_time1-calc_time0)/CLOCKS_PER_SEC;  \
  printTime(msg, i, i/calc_time);

{'fraction_non_alphanumeric': 0.17325949367088608, 'fraction_numerical': 0.014240506329113924, 'mean_word_length': 2.844984802431611, 'pattern_counts': {'":': 1, '<': 58, '<?xml version=': 0, '>': 7, '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': '3465806', 'n_tokens_mistral': 470, 'n_tokens_neox': 451, 'n_words': 78}