18 using time_point_h = std::chrono::time_point<std::chrono::system_clock, std::chrono::hours>;
19 using time_point_m = std::chrono::time_point<std::chrono::system_clock, std::chrono::minutes>;
20 using time_point_s = std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds>;
22 = std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds>;
24 = std::chrono::time_point<std::chrono::system_clock, std::chrono::microseconds>;
33 using system_time = std::chrono::system_clock::time_point;
34 using steady_time = std::chrono::steady_clock::time_point;
36 using timespan = std::chrono::duration<int64_t, std::nano>;
37 using timestamp = std::chrono::time_point<std::chrono::system_clock, timespan>;
41 m.def(
"test_chrono1", []() {
return std::chrono::system_clock::now(); });
45 m.def(
"test_chrono2", [](system_time
t) {
return t; });
49 m.def(
"test_chrono3", [](std::chrono::system_clock::duration
d) {
return d; });
53 m.def(
"test_chrono4", [](system_time
a, system_time
b) {
return a -
b; });
57 m.def(
"test_chrono5", []() {
return std::chrono::steady_clock::now(); });
61 m.def(
"test_chrono6", [](steady_time
t) {
return t; });
65 m.def(
"test_chrono7", [](std::chrono::microseconds
t) {
return t; });
67 m.def(
"test_chrono_float_diff",
68 [](std::chrono::duration<float>
a, std::chrono::duration<float>
b) {
return a -
b; });
70 m.def(
"test_nano_timepoint",
71 [](timestamp start, timespan
delta) -> timestamp {
return start +
delta; });
74 py::class_<different_resolutions>(
m,
"different_resolutions")