<commit_before>use std::time::Instant;
use std::fmt;
use std::thread;
use std::time::Duration;

pub struct Timer{
    time: Instant
}

impl Timer{
    pub fn new() -> Timer{
        Timer{time: Instant::now()}
    }

    pub fn elapsed_millis(&self) -> u64{
        (self.time.elapsed().as_secs() * 1000) + ((self.time.elapsed().subsec_nanos() / 1_000_000) as u64)
    }

    pub fn reset(&mut self){
        self.time = Instant::now();
    }

}

impl fmt::Debug for Timer {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{}", self.elapsed_millis())
    }
}

pub fn sleep(time: u64){
    thread::sleep(Duration::from_millis(time));
}<commit_msg>Added a function to get the UNIX time<commit_after>use std::time::Instant;
use std::fmt;
use std::thread;
use std::time::{SystemTime, UNIX_EPOCH, Duration};


pub struct Timer{
    time: Instant
}

impl Timer{
    pub fn new() -> Timer{
        Timer{time: Instant::now()}
    }

    pub fn elapsed_millis(&self) -> u64{
        (self.time.elapsed().as_secs() * 1000) + ((self.time.elapsed().subsec_nanos() / 1_000_000) as u64)
    }

    pub fn reset(&mut self){
        self.time = Instant::now();
    }

}

impl fmt::Debug for Timer {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{}", self.elapsed_millis())
    }
}

pub fn sleep(time: u64){
    thread::sleep(Duration::from_millis(time));
}

pub fn current_time_millis() -> u64{
    let start = SystemTime::now();

    let since_the_epoch = start.duration_since(UNIX_EPOCH)
        .expect("Time went backwards");

    since_the_epoch.as_secs() * 1000 +
            since_the_epoch.subsec_nanos() as u64 / 1_000_000
}
{'fraction_non_alphanumeric': 0.16726190476190475, 'fraction_numerical': 0.029166666666666667, 'mean_word_length': 3.181592039800995, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1393537', 'n_tokens_mistral': 661, 'n_tokens_neox': 601, 'n_words': 136}