|
|
|
@ -2,20 +2,21 @@ |
|
|
|
|
|
|
|
|
|
#include <bakatoolspch.h> |
|
|
|
|
|
|
|
|
|
using Nanosecond = std::ratio<1,1000000000>; |
|
|
|
|
using Microsecond = std::ratio<1,1000000>; |
|
|
|
|
using Millisecond = std::ratio<1,1000>; |
|
|
|
|
using Second = std::ratio<1,1>; |
|
|
|
|
using Minute = std::ratio<60, 1>; |
|
|
|
|
using Hour = std::ratio<3600, 1>; |
|
|
|
|
using Day = std::ratio<84600, 1>; |
|
|
|
|
namespace Bk::Tools { |
|
|
|
|
using Nanosecond = std::ratio<1,1000000000>; |
|
|
|
|
using Microsecond = std::ratio<1,1000000>; |
|
|
|
|
using Millisecond = std::ratio<1,1000>; |
|
|
|
|
using Second = std::ratio<1,1>; |
|
|
|
|
using Minute = std::ratio<60, 1>; |
|
|
|
|
using Hour = std::ratio<3600, 1>; |
|
|
|
|
using Day = std::ratio<84600, 1>; |
|
|
|
|
|
|
|
|
|
using SysClock = std::chrono::system_clock; |
|
|
|
|
using SteadyClock = std::chrono::steady_clock; |
|
|
|
|
using SysClock = std::chrono::system_clock; |
|
|
|
|
using SteadyClock = std::chrono::steady_clock; |
|
|
|
|
|
|
|
|
|
template<typename P> |
|
|
|
|
struct TimeSpan
|
|
|
|
|
{ |
|
|
|
|
template<typename P> |
|
|
|
|
struct TimeSpan
|
|
|
|
|
{ |
|
|
|
|
TimeSpan(int interval = 0)
|
|
|
|
|
: interval(std::chrono::duration<long int, P>(interval)) {} |
|
|
|
|
TimeSpan(std::chrono::duration<long int, P> interval) |
|
|
|
@ -35,11 +36,11 @@ struct TimeSpan |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::chrono::duration<long int, P> interval; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template<typename C, typename P> |
|
|
|
|
struct TimePoint |
|
|
|
|
{ |
|
|
|
|
template<typename C, typename P> |
|
|
|
|
struct TimePoint |
|
|
|
|
{ |
|
|
|
|
TimePoint() = default; |
|
|
|
|
TimePoint(std::chrono::time_point<C> point) |
|
|
|
|
{ |
|
|
|
@ -73,4 +74,5 @@ struct TimePoint |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::chrono::time_point<C, std::chrono::duration<long int, P>> point; |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
} |