16 {
17 m.doc() = "Nanobind bindings for Gibis classes";
18 nb::class_<PClockNs>(m, "PClockNs")
19
20 .def(nb::init<>())
21
22
23 .def_prop_rw("offsetTimeNs",
24 [](PClockNs &c) { return c.getOffsetTimeNs(); },
25 [](PClockNs &c, time_t value) { c.setOffsetTimeNs(value); })
26
27
28 .def("getFullTimeNs", &PClockNs::getFullTimeNs,
29 "Get the full time in nanoseconds")
30
31 .def("getDateNs", &PClockNs::getDateNs,
32 "Get the date at nanosecond precision")
33
34 .def("getDateCompactNs", &PClockNs::getDateCompactNs,
35 "Get the date at nanosecond precision in compact format")
36
37 .def("now", &PClockNs::now,
38 "Get the full time in nanoseconds (alias for getFullTimeNs)")
39
40 .def("sleep", [](const PClockNs &c, time_t ellapsedTime) {
41 c.sleep(ellapsedTime);
42 },
43 "Sleep for the given elapsed time in nanoseconds");
44}