diff options
Diffstat (limited to 'ext/pybind11/tests/test_chrono.cpp')
-rw-r--r-- | ext/pybind11/tests/test_chrono.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/pybind11/tests/test_chrono.cpp b/ext/pybind11/tests/test_chrono.cpp index 195a93bba..899d08d8d 100644 --- a/ext/pybind11/tests/test_chrono.cpp +++ b/ext/pybind11/tests/test_chrono.cpp @@ -14,6 +14,10 @@ TEST_SUBMODULE(chrono, m) { using system_time = std::chrono::system_clock::time_point; using steady_time = std::chrono::steady_clock::time_point; + + using timespan = std::chrono::duration<int64_t, std::nano>; + using timestamp = std::chrono::time_point<std::chrono::system_clock, timespan>; + // test_chrono_system_clock // Return the current time off the wall clock m.def("test_chrono1", []() { return std::chrono::system_clock::now(); }); @@ -44,4 +48,8 @@ TEST_SUBMODULE(chrono, m) { // Float durations (issue #719) m.def("test_chrono_float_diff", [](std::chrono::duration<float> a, std::chrono::duration<float> b) { return a - b; }); + + m.def("test_nano_timepoint", [](timestamp start, timespan delta) -> timestamp { + return start + delta; + }); } |