<commit_before>#include "TicToc.h"
#include <iostream>
#ifdef WIN32
	#include "windows.h"
#endif

using namespace std;


TicToc::TicToc(const string prefix)
{
    mPrefix = prefix;
    Tic();
}

void TicToc::Tic()
{
#ifdef WIN32
    mLastTime = GetTickCount();
#else
    clock_gettime(CLOCK_REALTIME, &mLastTime);
#endif
}

double TicToc::Toc()
{
#ifdef WIN32
    int now_time;
    now_time = GetTickCount();
    return (now_time - mLastTime)/1000.0; //Convert to seconds
#else
    timespec now_time;
    clock_gettime(CLOCK_REALTIME, &now_time);
    return CalcTimeDiff(now_time, mLastTime);
#endif
}

double TicToc::TocPrint(const string prefix)
{
    double dt = Toc();
    if (prefix.empty())
    {
        cout << mPrefix << ": " << dt << endl;
    }
    else
    {
        cout << prefix << ": " << dt << endl;
    }

    return dt;
}

#ifndef WIN32
double TicToc::CalcTimeDiff(const timespec &time_now, const timespec &time_last)
{
    return (double)(time_now.tv_sec - time_last.tv_sec) + ( (double)(time_now.tv_nsec - time_last.tv_nsec) )/1000000000.0;
}
#endif<commit_msg>fixed #elif MAC...<commit_after>#include "TicToc.h"
#include <iostream>
#ifdef WIN32
	#include "windows.h"
#endif

using namespace std;


TicToc::TicToc(const string prefix)
{
    mPrefix = prefix;
    Tic();
}

void TicToc::Tic()
{
#ifdef WIN32
    mLastTime = GetTickCount();
#elif defined MAC
#else
    clock_gettime(CLOCK_REALTIME, &mLastTime);
#endif
}

double TicToc::Toc()
{
#ifdef WIN32
    int now_time;
    now_time = GetTickCount();
    return (now_time - mLastTime)/1000.0; //Convert to seconds
#elif defined MAC
	return 0;
#else
    timespec now_time;
    clock_gettime(CLOCK_REALTIME, &now_time);
    return CalcTimeDiff(now_time, mLastTime);
#endif
}

double TicToc::TocPrint(const string prefix)
{
    double dt = Toc();
    if (prefix.empty())
    {
        cout << mPrefix << ": " << dt << endl;
    }
    else
    {
        cout << prefix << ": " << dt << endl;
    }

    return dt;
}

#ifndef WIN32
#ifdef MAC
double TicToc::CalcTimeDiff(const timespec &time_now, const timespec &time_last)
{
    return (double)(time_now.tv_sec - time_last.tv_sec) + ( (double)(time_now.tv_nsec - time_last.tv_nsec) )/1000000000.0;
}
#endif
#endif
{'fraction_non_alphanumeric': 0.14100268576544314, 'fraction_numerical': 0.021933751119068933, 'mean_word_length': 3.5242914979757085, 'pattern_counts': {'":': 4, '<': 37, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '7362948', 'n_tokens_mistral': 896, 'n_tokens_neox': 858, 'n_words': 186}