<commit_before>/*
 * elapsed.hpp
 * a timer that has second precision
 *
 * written by janus_wel<<EMAIL>>
 * This source code is in the public domain, and has NO WARRANTY.
 * */

#ifndef ELAPSED_HPP
#define ELAPSED_HPP

#include <ctime>

namespace util {
    namespace time {
        class elapsed {
            private:
                std::time_t basis;

            public:
                inline elapsed(void) { set(); }
                inline void set(void) { std::time(&basis); }

                double get(void) const {
                    std::time_t current;
                    std::time(&current);
                    return std::difftime(current, basis);
                }
        };
    }
}

#endif // ELAPSED_HPP
<commit_msg>Change the names of functions<commit_after>/*
 * elapsed.hpp
 * a timer that has second precision
 *
 * written by janus_wel<<EMAIL>>
 * This source code is in the public domain, and has NO WARRANTY.
 * */

#ifndef ELAPSED_HPP
#define ELAPSED_HPP

#include <ctime>

namespace util {
    namespace time {
        class elapsed {
            private:
                std::time_t base;

            public:
                inline elapsed(void) { base(); }
                inline void reset(void) { std::time(&base); }

                /*
                 *  A return type of this function is __int64
                 *  (maybe, long int), because:
                 *
                 *      - The return type of std::difftime(2) is double.
                 *      - The significand of double is represented by 52 bits.
                 *
                 *  So the smallest type that represents all values of 52 bits
                 *  is __int64.
                 *  */
                inline unsigned __int64 operator()(void) const {
                    std::time_t current;
                    std::time(&current);
                    return static_cast<unsigned __int32>(std::difftime(current, base));
                }
        };
    }
}

#endif // ELAPSED_HPP

{'fraction_non_alphanumeric': 0.09231536926147704, 'fraction_numerical': 0.006487025948103792, 'mean_word_length': 1.448107448107448, 'pattern_counts': {'":': 0, '<': 10, '<?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': '6361501', 'n_tokens_mistral': 566, 'n_tokens_neox': 520, 'n_words': 162}