From b864bba9b702198631e298439c05873d35a4e16e Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Mon, 5 Aug 2019 21:33:27 +0200 Subject: [PATCH] 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 --- bindings/cxx/examples/gpiomoncxx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()); -- 2.30.2