<commit_before>#include <stdio.h>
#include <stdlib.h>
#include "median.h"


using namespace std;

int main () 
{
    srand (time(NULL));
    MedianList a;
    for (int i=0; i<100000; i++)
    {
        int r = rand() % 100000 + 0;
        a.insert(r);
    }
    cout<<a.getMedian();
    return 0;
}
<commit_msg>Add average time calculation<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#include <vector>
#include "median.h"

#define ITER 10000


using namespace std;

clock_t insertTime = 0, deleteTime = 0, starting_time;

void printAverageTime()
{
    cout<<"Average insertion time: "
        <<((double)insertTime/ITER)/CLOCKS_PER_SEC<<endl;
    cout<<"Average deletion time: "
        <<((double)deleteTime/ITER)/CLOCKS_PER_SEC<<endl;
}

int main (void)
{

    vector<int> values;

    srand (time(NULL));
    MedianList container;

    /* Insert values to container and calculate insertion time */
    for (int i=0; i<ITER; i++)
    {
        int r = rand() % 10000 + 137;
        values.push_back(r);

        starting_time = clock();

        container.insert(r);

        insertTime += clock() - starting_time;
    }

    cout<<"median: "<<container.getMedian()<<endl;

    /* Delete all values from container and calculate deletion time */
    while (!values.empty())
    {
        starting_time = clock();

        container.remove(values.back());

        deleteTime += clock() - starting_time;
        values.pop_back();
    }

    printAverageTime();

    return 0;
}

{'fraction_non_alphanumeric': 0.1454183266932271, 'fraction_numerical': 0.021248339973439574, 'mean_word_length': 2.7675, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 10, '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': '5770573', 'n_tokens_mistral': 546, 'n_tokens_neox': 485, 'n_words': 121}