<commit_before>#include <algorithm>
#include <iostream>
#include <iomanip>
#include "timing.h"

TimingStatistics TimingStatistics::_instance;

double
Timer::elapsed() const {

	boost::chrono::nanoseconds ns(_timer.elapsed().wall);
	boost::chrono::duration<double> s = ns;

	return s.count();
}
TimingStatistics::TimingStatistics() :
	_longestIdentifierLength(0) {}

void
TimingStatistics::addTimer(const Timer& timer) {

	_instance.add(timer);
}

TimingStatistics::~TimingStatistics() {

	if (_timers.size() == 0)
		return;

	const std::string spacer("   ");

	std::cout
			<< "timing summary in seconds (wall time):"
			<< std::endl << std::endl;

	for (int i = 0; i < _longestIdentifierLength; i++)
		std::cout << " ";
	std::cout << spacer;
	std::cout << "   # runs" << spacer;
	std::cout << "mean     " << spacer;
	std::cout << "min      " << spacer;
	std::cout << "max      " << spacer;
	std::cout << "median   " << spacer;
	std::cout << "total" << std::endl << std::endl;

	for (const Timers::value_type& p : _timers) {

		const std::string&        identifier = p.first;
		const std::vector<Timer>& timers     = p.second;

		int numRuns = timers.size();
		double total = 0;
		std::vector<double> times;

		for (const Timer& t : timers) {

			total += t.elapsed();
			times.push_back(t.elapsed());
		}
<commit_msg>timing: changed output to system time<commit_after>#include <algorithm>
#include <iostream>
#include <iomanip>
#include "timing.h"

TimingStatistics TimingStatistics::_instance;

double
Timer::elapsed() const {

	boost::chrono::nanoseconds ns(_timer.elapsed().system);
	boost::chrono::duration<double> s = ns;

	return s.count();
}
TimingStatistics::TimingStatistics() :
	_longestIdentifierLength(0) {}

void
TimingStatistics::addTimer(const Timer& timer) {

	_instance.add(timer);
}

TimingStatistics::~TimingStatistics() {

	if (_timers.size() == 0)
		return;

	const std::string spacer("   ");

	std::cout
			<< "timing summary in seconds (cpu time):"
			<< std::endl << std::endl;

	for (int i = 0; i < _longestIdentifierLength; i++)
		std::cout << " ";
	std::cout << spacer;
	std::cout << "   # runs" << spacer;
	std::cout << "mean     " << spacer;
	std::cout << "min      " << spacer;
	std::cout << "max      " << spacer;
	std::cout << "median   " << spacer;
	std::cout << "total" << std::endl << std::endl;

	for (const Timers::value_type& p : _timers) {

		const std::string&        identifier = p.first;
		const std::vector<Timer>& timers     = p.second;

		int numRuns = timers.size();
		double total = 0;
		std::vector<double> times;

		for (const Timer& t : timers) {

			total += t.elapsed();
			times.push_back(t.elapsed());
		}

{'fraction_non_alphanumeric': 0.18075911311537016, 'fraction_numerical': 0.003006388575723412, 'mean_word_length': 4.138996138996139, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 15, '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': '282915', 'n_tokens_mistral': 1004, 'n_tokens_neox': 921, 'n_words': 209}