-struct Log : public std::ofstream {
- Log(const std::string& f = "log.txt") : std::ofstream(f.c_str(), std::ios::out | std::ios::app) {}
- ~Log() { if (is_open()) close(); }
-};
-
-
-class Time {
-public:
- void restart() { system_time(&t); }
- uint64_t msec() const { return time_to_msec(t); }
- int elapsed() const { return int(current_time().msec() - time_to_msec(t)); }