CppLibrary

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub Tiramister/CppLibrary

:warning: Tools/timer.hpp

Code

#pragma once

#include <chrono>

struct Timer {
    std::chrono::time_point<std::chrono::system_clock> begin;

    void init() {
        begin = std::chrono::system_clock::now();
    }

    int get_ms() {
        auto cur = std::chrono::system_clock::now();
        return std::chrono::
            duration_cast<std::chrono::milliseconds>(cur - begin)
                .count();
    }
};
#line 2 "Tools/timer.hpp"

#include <chrono>

struct Timer {
    std::chrono::time_point<std::chrono::system_clock> begin;

    void init() {
        begin = std::chrono::system_clock::now();
    }

    int get_ms() {
        auto cur = std::chrono::system_clock::now();
        return std::chrono::
            duration_cast<std::chrono::milliseconds>(cur - begin)
                .count();
    }
};
Back to top page