17 std::chrono::system_clock, std::chrono::hours>;
19 std::chrono::system_clock, std::chrono::minutes>;
21 std::chrono::system_clock, std::chrono::seconds>;
23 std::chrono::system_clock, std::chrono::milliseconds>;
25 std::chrono::system_clock, std::chrono::microseconds>;
34 using system_time = std::chrono::system_clock::time_point;
35 using steady_time = std::chrono::steady_clock::time_point;
37 using timespan = std::chrono::duration<int64_t, std::nano>;
38 using timestamp = std::chrono::time_point<std::chrono::system_clock, timespan>;
42 m.def(
"test_chrono1", []() {
return std::chrono::system_clock::now(); });
46 m.def(
"test_chrono2", [](system_time
t) {
return t; });
50 m.def(
"test_chrono3", [](std::chrono::system_clock::duration
d) {
return d; });
54 m.def(
"test_chrono4", [](system_time
a, system_time
b) {
return a -
b; });
58 m.def(
"test_chrono5", []() {
return std::chrono::steady_clock::now(); });
62 m.def(
"test_chrono6", [](steady_time t) {
return t; });
66 m.def(
"test_chrono7", [](std::chrono::microseconds t) {
return t; });
68 m.def(
"test_chrono_float_diff", [](std::chrono::duration<float> a, std::chrono::duration<float> b) {
71 m.def(
"test_nano_timepoint", [](timestamp start, timespan
delta) -> timestamp {
76 py::class_<different_resolutions>(
m,
"different_resolutions")
std::chrono::time_point< std::chrono::system_clock, std::chrono::milliseconds > time_point_ms
std::chrono::time_point< std::chrono::system_clock, std::chrono::microseconds > time_point_us
time_point_us timestamp_us
TEST_SUBMODULE(chrono, m)
std::chrono::time_point< std::chrono::system_clock, std::chrono::hours > time_point_h
std::chrono::time_point< std::chrono::system_clock, std::chrono::minutes > time_point_m
std::chrono::time_point< std::chrono::system_clock, std::chrono::seconds > time_point_s
time_point_ms timestamp_ms