<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 22 Mar 2022 at 22:49, Kieran Bingham via libcamera-devel <<a href="mailto:libcamera-devel@lists.libcamera.org">libcamera-devel@lists.libcamera.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Laurent,<br>
<br>
Quoting Laurent Pinchart via libcamera-devel (2022-03-22 20:42:48)<br>
> The start(unsigned int msec) overload is error-prone, as the argument<br>
> unit can easily be mistaken in callers. Drop it and update all callers<br>
> to use the start(std::chrono::milliseconds) overload instead.<br>
> <br>
> The callers now need to use std::chrono_literals. The using statement<br>
> could be added to timer.h for convenience, but "using" is discouraged in<br>
> header files to avoid namespace pollution. Update the callers instead,<br>
> and while at it, sort the "using" statements alphabetically in tests.<br>
> <br>
<br>
Does a utils::Duration implicitly get cast/converted to a<br>
std::chrono::milliseconds() with this now?<br></blockquote><div><br></div><div>Annoyingly not, as the utils::Duration base type is a double, and</div><div>std::chrono::milliseconds uses an integer.  So you need to explicitly</div><div>do a std::chrono::duration_cast<>.  We could consider switching the</div><div>utils::Duration base type to an integer as well (something we had talked</div><div>about in the past), I very much doubt double precision is absolutely </div><div>necessary.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I.e. - does this help ease Naush's patches to accept a utils::duration?<br>
(Which is a good-thing-tm I think)<br></blockquote><div><br></div><div>I think Laurent's intention is to move utils::Duration to the public interface,</div><div>so we may not be able to use utils::Duration in the Timer class.  That is</div><div>not a big issue for me, but I'll reply to that thread separately.</div><div><br></div><div>Naush</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Anyway, I have a lot of fondness for chrono-literals. I think they<br>
really help improve readability, and I expect prevent bugs.<br>
<br>
Reviewed-by: Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com" target="_blank">kieran.bingham@ideasonboard.com</a>><br>
<br>
> Signed-off-by: Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com" target="_blank">laurent.pinchart@ideasonboard.com</a>><br>
> ---<br>
>  include/libcamera/base/timer.h           |  1 -<br>
>  src/libcamera/base/timer.cpp             | 10 --------<br>
>  src/libcamera/ipc_pipe_unixsocket.cpp    |  4 ++-<br>
>  test/camera/buffer_import.cpp            |  3 ++-<br>
>  test/camera/camera_reconfigure.cpp       |  3 ++-<br>
>  test/camera/capture.cpp                  |  3 ++-<br>
>  test/event-dispatcher.cpp                |  9 ++++---<br>
>  test/event.cpp                           | 11 +++++----<br>
>  test/fence.cpp                           |  6 ++---<br>
>  test/hotplug-cameras.cpp                 |  5 ++--<br>
>  test/ipa/ipa_interface_test.cpp          |  9 ++++---<br>
>  test/ipc/unixsocket.cpp                  |  5 ++--<br>
>  test/log/log_process.cpp                 |  5 ++--<br>
>  test/process/process_test.cpp            |  5 ++--<br>
>  test/timer-thread.cpp                    |  7 +++---<br>
>  test/timer.cpp                           | 31 ++++++++++++------------<br>
>  test/v4l2_videodevice/buffer_sharing.cpp |  3 ++-<br>
>  test/v4l2_videodevice/capture_async.cpp  |  3 ++-<br>
>  test/v4l2_videodevice/v4l2_m2mdevice.cpp |  5 ++--<br>
>  19 files changed, 67 insertions(+), 61 deletions(-)<br>
> <br>
> diff --git a/include/libcamera/base/timer.h b/include/libcamera/base/timer.h<br>
> index 09f1d3229bd5..759b68ada1e8 100644<br>
> --- a/include/libcamera/base/timer.h<br>
> +++ b/include/libcamera/base/timer.h<br>
> @@ -25,7 +25,6 @@ public:<br>
>         Timer(Object *parent = nullptr);<br>
>         ~Timer();<br>
>       <br>
> -       void start(unsigned int msec) { start(std::chrono::milliseconds(msec)); }<br>
>         void start(std::chrono::milliseconds duration);<br>
>         void start(std::chrono::steady_clock::time_point deadline);<br>
>         void stop();<br>
> diff --git a/src/libcamera/base/timer.cpp b/src/libcamera/base/timer.cpp<br>
> index 187336e3a1a4..74b060af32ff 100644<br>
> --- a/src/libcamera/base/timer.cpp<br>
> +++ b/src/libcamera/base/timer.cpp<br>
> @@ -62,16 +62,6 @@ Timer::~Timer()<br>
>         stop();<br>
>  }<br>
>  <br>
> -/**<br>
> - * \fn Timer::start(unsigned int msec)<br>
> - * \brief Start or restart the timer with a timeout of \a msec<br>
> - * \param[in] msec The timer duration in milliseconds<br>
> - *<br>
> - * If the timer is already running it will be stopped and restarted.<br>
> - *<br>
> - * \context This function is \threadbound.<br>
> - */<br>
> -<br>
>  /**<br>
>   * \brief Start or restart the timer with a timeout of \a duration<br>
>   * \param[in] duration The timer duration in milliseconds<br>
> diff --git a/src/libcamera/ipc_pipe_unixsocket.cpp b/src/libcamera/ipc_pipe_unixsocket.cpp<br>
> index 3ef907090131..da2cffc3b149 100644<br>
> --- a/src/libcamera/ipc_pipe_unixsocket.cpp<br>
> +++ b/src/libcamera/ipc_pipe_unixsocket.cpp<br>
> @@ -18,6 +18,8 @@<br>
>  #include "libcamera/internal/ipc_unixsocket.h"<br>
>  #include "libcamera/internal/process.h"<br>
>  <br>
> +using namespace std::chrono_literals;<br>
> +<br>
>  namespace libcamera {<br>
>  <br>
>  LOG_DECLARE_CATEGORY(IPCPipe)<br>
> @@ -126,7 +128,7 @@ int IPCPipeUnixSocket::call(const IPCUnixSocket::Payload &message,<br>
>         }<br>
>  <br>
>         /* \todo Make this less dangerous, see IPCPipe::sendSync() */<br>
> -       timeout.start(2000);<br>
> +       timeout.start(2000ms);<br>
>         while (!iter->second.done) {<br>
>                 if (!timeout.isRunning()) {<br>
>                         LOG(IPCPipe, Error) << "Call timeout!";<br>
> diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp<br>
> index c504ea09e64b..9288400474a7 100644<br>
> --- a/test/camera/buffer_import.cpp<br>
> +++ b/test/camera/buffer_import.cpp<br>
> @@ -25,6 +25,7 @@<br>
>  #include "test.h"<br>
>  <br>
>  using namespace libcamera;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  namespace {<br>
>  <br>
> @@ -135,7 +136,7 @@ protected:<br>
>                 EventDispatcher *dispatcher = Thread::current()->eventDispatcher();<br>
>  <br>
>                 Timer timer;<br>
> -               timer.start(1000);<br>
> +               timer.start(1000ms);<br>
>                 while (timer.isRunning())<br>
>                         dispatcher->processEvents();<br>
>  <br>
> diff --git a/test/camera/camera_reconfigure.cpp b/test/camera/camera_reconfigure.cpp<br>
> index 0fd8ab70d561..f6076baa0a31 100644<br>
> --- a/test/camera/camera_reconfigure.cpp<br>
> +++ b/test/camera/camera_reconfigure.cpp<br>
> @@ -23,6 +23,7 @@<br>
>  <br>
>  using namespace libcamera;<br>
>  using namespace std;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  namespace {<br>
>  <br>
> @@ -117,7 +118,7 @@ private:<br>
>                 EventDispatcher *dispatcher = Thread::current()->eventDispatcher();<br>
>  <br>
>                 Timer timer;<br>
> -               timer.start(100);<br>
> +               timer.start(100ms);<br>
>                 while (timer.isRunning())<br>
>                         dispatcher->processEvents();<br>
>  <br>
> diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp<br>
> index f3824f95cbd3..de824083dfed 100644<br>
> --- a/test/camera/capture.cpp<br>
> +++ b/test/camera/capture.cpp<br>
> @@ -18,6 +18,7 @@<br>
>  <br>
>  using namespace libcamera;<br>
>  using namespace std;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  namespace {<br>
>  <br>
> @@ -137,7 +138,7 @@ protected:<br>
>                 EventDispatcher *dispatcher = Thread::current()->eventDispatcher();<br>
>  <br>
>                 Timer timer;<br>
> -               timer.start(1000);<br>
> +               timer.start(1000ms);<br>
>                 while (timer.isRunning())<br>
>                         dispatcher->processEvents();<br>
>  <br>
> diff --git a/test/event-dispatcher.cpp b/test/event-dispatcher.cpp<br>
> index 1cc17b045ec0..9b07ab2b61d7 100644<br>
> --- a/test/event-dispatcher.cpp<br>
> +++ b/test/event-dispatcher.cpp<br>
> @@ -16,8 +16,9 @@<br>
>  <br>
>  #include "test.h"<br>
>  <br>
> -using namespace std;<br>
>  using namespace libcamera;<br>
> +using namespace std;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  static EventDispatcher *dispatcher;<br>
>  static bool interrupt;<br>
> @@ -50,7 +51,7 @@ protected:<br>
>                 /* Event processing interruption by signal. */<br>
>                 std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now();<br>
>  <br>
> -               timer.start(1000);<br>
> +               timer.start(1000ms);<br>
>  <br>
>                 struct itimerval itimer = {};<br>
>                 itimer.it_value.tv_usec = 500000;<br>
> @@ -69,7 +70,7 @@ protected:<br>
>                 }<br>
>  <br>
>                 /* Event processing interruption. */<br>
> -               timer.start(1000);<br>
> +               timer.start(1000ms);<br>
>                 dispatcher->interrupt();<br>
>  <br>
>                 dispatcher->processEvents();<br>
> @@ -79,7 +80,7 @@ protected:<br>
>                         return TestFail;<br>
>                 }<br>
>  <br>
> -               timer.start(1000);<br>
> +               timer.start(1000ms);<br>
>                 itimer.it_value.tv_usec = 500000;<br>
>                 interrupt = true;<br>
>                 setitimer(ITIMER_REAL, &itimer, nullptr);<br>
> diff --git a/test/event.cpp b/test/event.cpp<br>
> index d4765eb14d12..19dceae123dd 100644<br>
> --- a/test/event.cpp<br>
> +++ b/test/event.cpp<br>
> @@ -16,8 +16,9 @@<br>
>  <br>
>  #include "test.h"<br>
>  <br>
> -using namespace std;<br>
>  using namespace libcamera;<br>
> +using namespace std;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  class EventTest : public Test<br>
>  {<br>
> @@ -55,7 +56,7 @@ protected:<br>
>                         return TestFail;<br>
>                 }<br>
>  <br>
> -               timeout.start(100);<br>
> +               timeout.start(100ms);<br>
>                 dispatcher->processEvents();<br>
>                 timeout.stop();<br>
>  <br>
> @@ -67,7 +68,7 @@ protected:<br>
>                 /* Test read notification without data. */<br>
>                 notified_ = false;<br>
>  <br>
> -               timeout.start(100);<br>
> +               timeout.start(100ms);<br>
>                 dispatcher->processEvents();<br>
>                 timeout.stop();<br>
>  <br>
> @@ -86,7 +87,7 @@ protected:<br>
>                         return TestFail;<br>
>                 }<br>
>  <br>
> -               timeout.start(100);<br>
> +               timeout.start(100ms);<br>
>                 dispatcher->processEvents();<br>
>                 timeout.stop();<br>
>  <br>
> @@ -99,7 +100,7 @@ protected:<br>
>                 notified_ = false;<br>
>                 notifier_->setEnabled(true);<br>
>  <br>
> -               timeout.start(100);<br>
> +               timeout.start(100ms);<br>
>                 dispatcher->processEvents();<br>
>                 timeout.stop();<br>
>  <br>
> diff --git a/test/fence.cpp b/test/fence.cpp<br>
> index 524db2a10757..1e38bc2f8790 100644<br>
> --- a/test/fence.cpp<br>
> +++ b/test/fence.cpp<br>
> @@ -22,9 +22,9 @@<br>
>  #include "camera_test.h"<br>
>  #include "test.h"<br>
>  <br>
> -using namespace std::chrono_literals;<br>
>  using namespace libcamera;<br>
>  using namespace std;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  class FenceTest : public CameraTest, public Test<br>
>  {<br>
> @@ -316,7 +316,7 @@ int FenceTest::run()<br>
>  <br>
>         /* Loop for one second. */<br>
>         Timer timer;<br>
> -       timer.start(1000);<br>
> +       timer.start(1000ms);<br>
>         while (timer.isRunning() && expectedCompletionResult_) {<br>
>                 if (completedRequest_ == signalledRequestId_ && setFence_)<br>
>                         /*<br>
> @@ -324,7 +324,7 @@ int FenceTest::run()<br>
>                          * been re-queued with a fence. Start the timer to<br>
>                          * signal the fence in 10 msec.<br>
>                          */<br>
> -                       fenceTimer.start(10);<br>
> +                       fenceTimer.start(10ms);<br>
>  <br>
>                 dispatcher_->processEvents();<br>
>         }<br>
> diff --git a/test/hotplug-cameras.cpp b/test/hotplug-cameras.cpp<br>
> index df56040350c5..5d9260a241ec 100644<br>
> --- a/test/hotplug-cameras.cpp<br>
> +++ b/test/hotplug-cameras.cpp<br>
> @@ -22,6 +22,7 @@<br>
>  #include "test.h"<br>
>  <br>
>  using namespace libcamera;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  class HotplugTest : public Test<br>
>  {<br>
> @@ -88,7 +89,7 @@ protected:<br>
>                 std::ofstream(uvcDriverDir_ + "unbind", std::ios::binary)<br>
>                         << uvcDeviceDir;<br>
>                 Timer timer;<br>
> -               timer.start(1000);<br>
> +               timer.start(1000ms);<br>
>                 while (timer.isRunning() && !cameraRemoved_)<br>
>                         Thread::current()->eventDispatcher()->processEvents();<br>
>                 if (!cameraRemoved_) {<br>
> @@ -99,7 +100,7 @@ protected:<br>
>                 /* Bind the camera again and process events. */<br>
>                 std::ofstream(uvcDriverDir_ + "bind", std::ios::binary)<br>
>                         << uvcDeviceDir;<br>
> -               timer.start(1000);<br>
> +               timer.start(1000ms);<br>
>                 while (timer.isRunning() && !cameraAdded_)<br>
>                         Thread::current()->eventDispatcher()->processEvents();<br>
>                 if (!cameraAdded_) {<br>
> diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp<br>
> index 43562e608506..3c0df843ea61 100644<br>
> --- a/test/ipa/ipa_interface_test.cpp<br>
> +++ b/test/ipa/ipa_interface_test.cpp<br>
> @@ -27,8 +27,9 @@<br>
>  <br>
>  #include "test.h"<br>
>  <br>
> -using namespace std;<br>
>  using namespace libcamera;<br>
> +using namespace std;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  class IPAInterfaceTest : public Test, public Object<br>
>  {<br>
> @@ -111,7 +112,7 @@ protected:<br>
>                         return TestFail;<br>
>                 }<br>
>  <br>
> -               timer.start(1000);<br>
> +               timer.start(1000ms);<br>
>                 while (timer.isRunning() && trace_ != ipa::vimc::IPAOperationInit)<br>
>                         dispatcher->processEvents();<br>
>  <br>
> @@ -123,7 +124,7 @@ protected:<br>
>  <br>
>                 /* Test start of IPA module. */<br>
>                 ipa_->start();<br>
> -               timer.start(1000);<br>
> +               timer.start(1000ms);<br>
>                 while (timer.isRunning() && trace_ != ipa::vimc::IPAOperationStart)<br>
>                         dispatcher->processEvents();<br>
>  <br>
> @@ -134,7 +135,7 @@ protected:<br>
>  <br>
>                 /* Test stop of IPA module. */<br>
>                 ipa_->stop();<br>
> -               timer.start(1000);<br>
> +               timer.start(1000ms);<br>
>                 while (timer.isRunning() && trace_ != ipa::vimc::IPAOperationStop)<br>
>                         dispatcher->processEvents();<br>
>  <br>
> diff --git a/test/ipc/unixsocket.cpp b/test/ipc/unixsocket.cpp<br>
> index 7e90e629e9ac..304e613bc984 100644<br>
> --- a/test/ipc/unixsocket.cpp<br>
> +++ b/test/ipc/unixsocket.cpp<br>
> @@ -30,8 +30,9 @@<br>
>  #define CMD_LEN_CMP    3<br>
>  #define CMD_JOIN       4<br>
>  <br>
> -using namespace std;<br>
>  using namespace libcamera;<br>
> +using namespace std;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  int calculateLength(int fd)<br>
>  {<br>
> @@ -430,7 +431,7 @@ private:<br>
>                 if (ret)<br>
>                         return ret;<br>
>  <br>
> -               timeout.start(200);<br>
> +               timeout.start(200ms);<br>
>                 while (!callDone_) {<br>
>                         if (!timeout.isRunning()) {<br>
>                                 cerr << "Call timeout!" << endl;<br>
> diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp<br>
> index 2484c58f2fa9..966b80cf3af7 100644<br>
> --- a/test/log/log_process.cpp<br>
> +++ b/test/log/log_process.cpp<br>
> @@ -26,8 +26,9 @@<br>
>  <br>
>  #include "test.h"<br>
>  <br>
> -using namespace std;<br>
>  using namespace libcamera;<br>
> +using namespace std;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  static const string message("hello from the child");<br>
>  <br>
> @@ -80,7 +81,7 @@ protected:<br>
>                         return TestFail;<br>
>                 }<br>
>  <br>
> -               timeout.start(200);<br>
> +               timeout.start(200ms);<br>
>                 while (timeout.isRunning())<br>
>                         dispatcher->processEvents();<br>
>  <br>
> diff --git a/test/process/process_test.cpp b/test/process/process_test.cpp<br>
> index b410756b3288..cb6940c6a7db 100644<br>
> --- a/test/process/process_test.cpp<br>
> +++ b/test/process/process_test.cpp<br>
> @@ -18,8 +18,9 @@<br>
>  <br>
>  #include "test.h"<br>
>  <br>
> -using namespace std;<br>
>  using namespace libcamera;<br>
> +using namespace std;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  class ProcessTestChild<br>
>  {<br>
> @@ -61,7 +62,7 @@ protected:<br>
>                         return TestFail;<br>
>                 }<br>
>  <br>
> -               timeout.start(2000);<br>
> +               timeout.start(2000ms);<br>
>                 while (timeout.isRunning() && exitStatus_ == Process::NotExited)<br>
>                         dispatcher->processEvents();<br>
>  <br>
> diff --git a/test/timer-thread.cpp b/test/timer-thread.cpp<br>
> index f7e8743da9e6..618217538779 100644<br>
> --- a/test/timer-thread.cpp<br>
> +++ b/test/timer-thread.cpp<br>
> @@ -14,8 +14,9 @@<br>
>  <br>
>  #include "test.h"<br>
>  <br>
> -using namespace std;<br>
>  using namespace libcamera;<br>
> +using namespace std;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  class TimeoutHandler : public Object<br>
>  {<br>
> @@ -24,13 +25,13 @@ public:<br>
>                 : timer_(this), timeout_(false)<br>
>         {<br>
>                 timer_.timeout.connect(this, &TimeoutHandler::timeoutHandler);<br>
> -               timer_.start(100);<br>
> +               timer_.start(100ms);<br>
>         }<br>
>  <br>
>         void restart()<br>
>         {<br>
>                 timeout_ = false;<br>
> -               timer_.start(100);<br>
> +               timer_.start(100ms);<br>
>         }<br>
>  <br>
>         bool timeout() const<br>
> diff --git a/test/timer.cpp b/test/timer.cpp<br>
> index be79d0100a58..0f01c3cb00ea 100644<br>
> --- a/test/timer.cpp<br>
> +++ b/test/timer.cpp<br>
> @@ -14,8 +14,9 @@<br>
>  <br>
>  #include "test.h"<br>
>  <br>
> -using namespace std;<br>
>  using namespace libcamera;<br>
> +using namespace std;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  class ManagedTimer : public Timer<br>
>  {<br>
> @@ -26,7 +27,7 @@ public:<br>
>                 timeout.connect(this, &ManagedTimer::timeoutHandler);<br>
>         }<br>
>  <br>
> -       void start(int msec)<br>
> +       void start(std::chrono::milliseconds msec)<br>
>         {<br>
>                 count_ = 0;<br>
>                 start_ = std::chrono::steady_clock::now();<br>
> @@ -82,7 +83,7 @@ protected:<br>
>                 ManagedTimer timer2;<br>
>  <br>
>                 /* Timer expiration. */<br>
> -               timer.start(1000);<br>
> +               timer.start(1000ms);<br>
>  <br>
>                 if (!timer.isRunning()) {<br>
>                         cout << "Timer expiration test failed" << endl;<br>
> @@ -101,7 +102,7 @@ protected:<br>
>                  * Nanosecond resolution in a 32 bit value wraps at 4.294967<br>
>                  * seconds (0xFFFFFFFF / 1000000)<br>
>                  */<br>
> -               timer.start(4295);<br>
> +               timer.start(4295ms);<br>
>                 dispatcher->processEvents();<br>
>  <br>
>                 if (timer.hasFailed()) {<br>
> @@ -110,7 +111,7 @@ protected:<br>
>                 }<br>
>  <br>
>                 /* Timer restart. */<br>
> -               timer.start(500);<br>
> +               timer.start(500ms);<br>
>  <br>
>                 if (!timer.isRunning()) {<br>
>                         cout << "Timer restart test failed" << endl;<br>
> @@ -125,9 +126,9 @@ protected:<br>
>                 }<br>
>  <br>
>                 /* Timer restart before expiration. */<br>
> -               timer.start(50);<br>
> -               timer.start(100);<br>
> -               timer.start(150);<br>
> +               timer.start(50ms);<br>
> +               timer.start(100ms);<br>
> +               timer.start(150ms);<br>
>  <br>
>                 dispatcher->processEvents();<br>
>  <br>
> @@ -147,8 +148,8 @@ protected:<br>
>                 }<br>
>  <br>
>                 /* Two timers. */<br>
> -               timer.start(1000);<br>
> -               timer2.start(300);<br>
> +               timer.start(1000ms);<br>
> +               timer2.start(300ms);<br>
>  <br>
>                 dispatcher->processEvents();<br>
>  <br>
> @@ -170,8 +171,8 @@ protected:<br>
>                 }<br>
>  <br>
>                 /* Restart timer before expiration. */<br>
> -               timer.start(1000);<br>
> -               timer2.start(300);<br>
> +               timer.start(1000ms);<br>
> +               timer2.start(300ms);<br>
>  <br>
>                 dispatcher->processEvents();<br>
>  <br>
> @@ -180,7 +181,7 @@ protected:<br>
>                         return TestFail;<br>
>                 }<br>
>  <br>
> -               timer.start(1000);<br>
> +               timer.start(1000ms);<br>
>  <br>
>                 dispatcher->processEvents();<br>
>  <br>
> @@ -194,10 +195,10 @@ protected:<br>
>                  * deleted. This will result in a crash on failure.<br>
>                  */<br>
>                 ManagedTimer *dyntimer = new ManagedTimer();<br>
> -               dyntimer->start(100);<br>
> +               dyntimer->start(100ms);<br>
>                 delete dyntimer;<br>
>  <br>
> -               timer.start(200);<br>
> +               timer.start(200ms);<br>
>                 dispatcher->processEvents();<br>
>  <br>
>                 return TestPass;<br>
> diff --git a/test/v4l2_videodevice/buffer_sharing.cpp b/test/v4l2_videodevice/buffer_sharing.cpp<br>
> index 75ee93ce5261..fa856ab6b5a8 100644<br>
> --- a/test/v4l2_videodevice/buffer_sharing.cpp<br>
> +++ b/test/v4l2_videodevice/buffer_sharing.cpp<br>
> @@ -21,6 +21,7 @@<br>
>  #include "v4l2_videodevice_test.h"<br>
>  <br>
>  using namespace libcamera;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  class BufferSharingTest : public V4L2VideoDeviceTest<br>
>  {<br>
> @@ -145,7 +146,7 @@ protected:<br>
>                         return TestFail;<br>
>                 }<br>
>  <br>
> -               timeout.start(10000);<br>
> +               timeout.start(10000ms);<br>
>                 while (timeout.isRunning()) {<br>
>                         dispatcher->processEvents();<br>
>                         if (framesCaptured_ > 30 && framesOutput_ > 30)<br>
> diff --git a/test/v4l2_videodevice/capture_async.cpp b/test/v4l2_videodevice/capture_async.cpp<br>
> index 3aa4ca0b6955..42e1e671790b 100644<br>
> --- a/test/v4l2_videodevice/capture_async.cpp<br>
> +++ b/test/v4l2_videodevice/capture_async.cpp<br>
> @@ -16,6 +16,7 @@<br>
>  #include "v4l2_videodevice_test.h"<br>
>  <br>
>  using namespace libcamera;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  class CaptureAsyncTest : public V4L2VideoDeviceTest<br>
>  {<br>
> @@ -60,7 +61,7 @@ protected:<br>
>                 if (ret)<br>
>                         return TestFail;<br>
>  <br>
> -               timeout.start(10000);<br>
> +               timeout.start(10000ms);<br>
>                 while (timeout.isRunning()) {<br>
>                         dispatcher->processEvents();<br>
>                         if (frames > 30)<br>
> diff --git a/test/v4l2_videodevice/v4l2_m2mdevice.cpp b/test/v4l2_videodevice/v4l2_m2mdevice.cpp<br>
> index ebf3e245f86b..852b853fa81a 100644<br>
> --- a/test/v4l2_videodevice/v4l2_m2mdevice.cpp<br>
> +++ b/test/v4l2_videodevice/v4l2_m2mdevice.cpp<br>
> @@ -19,8 +19,9 @@<br>
>  <br>
>  #include "test.h"<br>
>  <br>
> -using namespace std;<br>
>  using namespace libcamera;<br>
> +using namespace std;<br>
> +using namespace std::chrono_literals;<br>
>  <br>
>  class V4L2M2MDeviceTest : public Test<br>
>  {<br>
> @@ -155,7 +156,7 @@ protected:<br>
>                 }<br>
>  <br>
>                 Timer timeout;<br>
> -               timeout.start(5000);<br>
> +               timeout.start(5000ms);<br>
>                 while (timeout.isRunning()) {<br>
>                         dispatcher->processEvents();<br>
>                         if (captureFrames_ > 30)<br>
> <br>
> base-commit: a8284e3570de133960458c5703e75dc9e8e737c8<br>
> -- <br>
> Regards,<br>
> <br>
> Laurent Pinchart<br>
><br>
</blockquote></div></div>