From: Bartosz Golaszewski Date: Mon, 5 Aug 2019 19:33:27 +0000 (+0200) Subject: bindings: cxx: examples: use seconds for timeout in line.event_wait() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b864bba9b702198631e298439c05873d35a4e16e;p=qemu-gpiodev%2Flibgpiod.git bindings: cxx: examples: use seconds for timeout in line.event_wait() While the event_wait() method takes ::std::chrono::nanoseconds as the timeout argument, we don't actually need to use the same type - we can use less fine-grained duration types. Switch to using seconds in the gpiomoncxx example to showcase this implicit conversion. Signed-off-by: Bartosz Golaszewski --- diff --git a/bindings/cxx/examples/gpiomoncxx.cpp b/bindings/cxx/examples/gpiomoncxx.cpp index c603d5d..75bd715 100644 --- a/bindings/cxx/examples/gpiomoncxx.cpp +++ b/bindings/cxx/examples/gpiomoncxx.cpp @@ -58,7 +58,7 @@ int main(int argc, char **argv) }); for (;;) { - auto events = lines.event_wait(::std::chrono::nanoseconds(1000000000)); + auto events = lines.event_wait(::std::chrono::seconds(1)); if (events) { for (auto& it: events) print_event(it.event_read());