/* This file is part of Fennix Kernel. Fennix Kernel is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Fennix Kernel is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Fennix Kernel. If not, see . */ #pragma once #include #include namespace std { namespace chrono { template > class duration { private: Rep rep_; std::ratio period_; public: constexpr duration() = default; duration(const duration &) = default; template constexpr explicit duration(const Rep2 &r); template constexpr duration(const duration &d); duration &operator=(const duration &other) = default; constexpr Rep count() const; static constexpr duration zero() noexcept; static constexpr duration min() noexcept; static constexpr duration max() noexcept; constexpr std::common_type_t operator+() const; constexpr std::common_type_t operator-() const; constexpr duration operator++(int) { return duration(rep_++); } constexpr duration operator--(int) { return duration(rep_--); } constexpr duration &operator++() { ++rep_; return *this; } constexpr duration &operator--() { --rep_; return *this; } constexpr duration &operator+=(const duration &d) { rep_ += d.count(); return *this; } constexpr duration &operator-=(const duration &d) { rep_ -= d.count(); return *this; } constexpr duration &operator*=(const Rep &rhs) { rep_ *= rhs; return *this; } constexpr duration &operator/=(const Rep &rhs) { rep_ /= rhs; return *this; } constexpr duration &operator%=(const Rep &rhs) { rep_ %= rhs; return *this; } constexpr duration &operator%=(const duration &rhs) { rep_ %= rhs.count(); return *this; } }; template class time_point; using nanoseconds = std::chrono::duration; using microseconds = std::chrono::duration; using milliseconds = std::chrono::duration; using seconds = std::chrono::duration; using minutes = std::chrono::duration>; using hours = std::chrono::duration>; using days = std::chrono::duration>; using weeks = std::chrono::duration>; using months = std::chrono::duration>; using years = std::chrono::duration>; } }