<commit_before>#ifndef SIMCODE_SIMTIME_H
#define SIMCODE_SIMTIME_H
#include <sys/time.h>
#include <time.h>

namespace simcode
{

#define MIN 60
#define HOUR 3600
#define DAY 86400

inline int get_day_sec(time_t ti)
{
    struct tm* t = localtime(&ti);
    int offset = t->tm_sec + t->tm_min*MIN + t->tm_hour*HOUR;
    return ti - offset;
}

class SimTimeGet
{
public:
    SimTimeGet()
    {
        gettimeofday(&m_st, NULL);
    }
    inline int64_t msec()
    {
        return (m_st.tv_sec*1000 + m_st.tv_usec/1000);
    }
    //时间差
    inline int  msec_interval()
    {
        gettimeofday(&m_et, NULL);
        return (m_et.tv_sec*1000 + m_et.tv_usec/1000) - (m_st.tv_sec*1000 + m_st.tv_usec/1000);
    }
    inline void reset()
    {
        gettimeofday(&m_st, NULL);
    }
private:
    struct timeval m_st;
    struct timeval m_et;
};
}
#endif<commit_msg>Update simtime.h<commit_after>#ifndef SIMCODE_SIMTIME_H
#define SIMCODE_SIMTIME_H
#include <sys/time.h>
#include <time.h>

namespace simcode
{

#define MIN 60
#define HOUR 3600
#define DAY 86400

inline int get_day_sec(time_t ti)
{
    struct tm* t = localtime(&ti);
    int offset = t->tm_sec + t->tm_min*MIN + t->tm_hour*HOUR;
    return ti - offset;
}

class SimTimeGet
{
public:
    SimTimeGet()
    {
        gettimeofday(&m_st, NULL);
    }
    inline int64_t msec()
    {
        return (int64_t(m_st.tv_sec)*1000 + int64_t(m_st.tv_usec)/1000);
    }
    //时间差
    inline int  msec_interval()
    {
        gettimeofday(&m_et, NULL);
        return (int64_t(m_et.tv_sec)*1000 + int64_t(m_et.tv_usec)/1000) - (int64_t(m_st.tv_sec)*1000 + int64_t(m_st.tv_usec)/1000);
    }
    inline void reset()
    {
        gettimeofday(&m_st, NULL);
    }
private:
    struct timeval m_st;
    struct timeval m_et;
};
}
#endif
{'fraction_non_alphanumeric': 0.12843522153673584, 'fraction_numerical': 0.04823331463825014, 'mean_word_length': 2.8698481561822127, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '6385779', 'n_tokens_mistral': 807, 'n_tokens_neox': 740, 'n_words': 142}