<commit_before>
#include <config.h>


#if defined(HAVE_CLOCK_GETTIME)

#include <time.h>

unsigned GetRunningMicroSecs()
{
    struct timespec	now;

    clock_gettime( CLOCK_MONOTONIC, &now );

    unsigned usecs = ((unsigned)now.tv_nsec)/1000 + ((unsigned)now.tv_sec) * 1000000;
//    unsigned msecs = (now.tv_nsec / (1000*1000)) + now.tv_sec * 1000;

    return usecs;
}


#elif defined(HAVE_GETTIMEOFDAY_FUNC)

#include <sys/time.h>
unsigned GetRunningMicroSecs()
{
    timeval tv;

    gettimeofday( &tv, 0 );

    return (tv.tv_sec * 1000000) + tv.tv_usec;
}


#elif defined(_WIN32)

#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#include <assert.h>

unsigned GetRunningMicroSecs()
{
    LARGE_INTEGER   curtime;

    static unsigned timerFreq;              // timer frequency

    if( !timerFreq )
    {
        QueryPerformanceFrequency( &curtime );

        timerFreq = curtime.QuadPart / 1000000;     // i.e., ticks per usec

        assert( timerFreq );
    }

    QueryPerformanceCounter( &curtime );

    return ( curtime.LowPart / timerFreq );
}

#endif
<commit_msg>fix windows version of GetRunningMicroSecs()<commit_after>
#include <config.h>


#if defined(HAVE_CLOCK_GETTIME)

#include <time.h>

unsigned GetRunningMicroSecs()
{
    struct timespec	now;

    clock_gettime( CLOCK_MONOTONIC, &now );

    unsigned usecs = ((unsigned)now.tv_nsec)/1000 + ((unsigned)now.tv_sec) * 1000000;
//    unsigned msecs = (now.tv_nsec / (1000*1000)) + now.tv_sec * 1000;

    return usecs;
}


#elif defined(HAVE_GETTIMEOFDAY_FUNC)

#include <sys/time.h>
unsigned GetRunningMicroSecs()
{
    timeval tv;

    gettimeofday( &tv, 0 );

    return (tv.tv_sec * 1000000) + tv.tv_usec;
}


#elif defined(_WIN32)

#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#include <assert.h>

unsigned GetRunningMicroSecs()
{
    FILETIME    now;

    GetSystemTimeAsFileTime( &now );

    typedef unsigned long long UINT64;

    UINT64 t = (UINT64(now.dwHighDateTime) << 32) + now.dwLowDateTime;

    t /= 10;

    return unsigned( t );
}


#if 0
// test program
#include <stdio.h>
int main( int argc, char** argv )
{
    unsigned then = GetRunningMicroSecs();

    Sleep( 2000 );      // Windows Sleep( msecs )

    printf( "delta: %u\n", GetRunningMicroSecs() - then );

    return 0;
}
#endif

#endif

{'fraction_non_alphanumeric': 0.12608695652173912, 'fraction_numerical': 0.041304347826086954, 'mean_word_length': 3.3009345794392524, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 14, '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': '1758579', 'n_tokens_mistral': 956, 'n_tokens_neox': 828, 'n_words': 186}