{"id":15512,"url":"https://patchwork.libcamera.org/api/1.1/patches/15512/?format=json","web_url":"https://patchwork.libcamera.org/patch/15512/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220322204248.9226-1-laurent.pinchart@ideasonboard.com>","date":"2022-03-22T20:42:48","name":"[libcamera-devel] libcamera: base: timer: Drop start() overload with int argument","commit_ref":"54398c1583f18ef9daf1a9227691b14c3b7f4212","pull_url":null,"state":"accepted","archived":false,"hash":"5e73e54dcb4c75422083ccdf337877a3516da751","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15512/mbox/","series":[{"id":2986,"url":"https://patchwork.libcamera.org/api/1.1/series/2986/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2986","date":"2022-03-22T20:42:48","name":"[libcamera-devel] libcamera: base: timer: Drop start() overload with int argument","version":1,"mbox":"https://patchwork.libcamera.org/series/2986/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15512/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15512/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3BC04C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Mar 2022 20:43:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9D852604DB;\n\tTue, 22 Mar 2022 21:43:10 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3A987604C5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Mar 2022 21:43:09 +0100 (CET)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A321BDFA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Mar 2022 21:43:08 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1647981790;\n\tbh=pmjgJYq3P+8k85qmdtnH3YzMcGsjAlwfqC37GHgpeq8=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=KpKPfc4r76onbzCk24+ac2+Pm4KSxXa0ajW2ckpBZXKv9Fgl5GFBorICmlx76QUZi\n\t5VxQQqXbm74tN1DkQ/jG2K3cDiTspZW2geF475JnFsCVHmvGdch/s8h0xc7tPvOVUE\n\tS5A1p8e+dCB9RFCZ086Itc+MGzhwNYhv7JbLlOQhnheHCjuocW+98CruhemAaFh758\n\tkoXJpQBo5AMjbPvJjnO2Cj8UVt7KpkRhPhe222Z12TOsP7cIvMPt9R+XsWJlZCMspc\n\txjb0u+eJ+GwxSFAAR0/KAy/L9/NL/7gbRxc1C7urx/RQTlf0oOUQPoqfzq+WSDvdK0\n\trT0S+SC9SgfSg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1647981788;\n\tbh=pmjgJYq3P+8k85qmdtnH3YzMcGsjAlwfqC37GHgpeq8=;\n\th=From:To:Subject:Date:From;\n\tb=J+Os3JodIzgCnJTl1URlCV8CaZo+7CMpIStupMfGEODexzFTIxfK4n1sS1YRb2d11\n\trKDSAPPrET547syIqBfkqH+DR1DiYgZiOOCWaM/GC6sCge9OrYbVnD3YvYSv36ZgHL\n\tMTScVPMW2LzreKJnF1ZtmisxGM64m460t9QI28HA="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"J+Os3Jod\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 22 Mar 2022 22:42:48 +0200","Message-Id":"<20220322204248.9226-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.34.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] libcamera: base: timer: Drop start()\n\toverload with int argument","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The start(unsigned int msec) overload is error-prone, as the argument\nunit can easily be mistaken in callers. Drop it and update all callers\nto use the start(std::chrono::milliseconds) overload instead.\n\nThe callers now need to use std::chrono_literals. The using statement\ncould be added to timer.h for convenience, but \"using\" is discouraged in\nheader files to avoid namespace pollution. Update the callers instead,\nand while at it, sort the \"using\" statements alphabetically in tests.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/base/timer.h           |  1 -\n src/libcamera/base/timer.cpp             | 10 --------\n src/libcamera/ipc_pipe_unixsocket.cpp    |  4 ++-\n test/camera/buffer_import.cpp            |  3 ++-\n test/camera/camera_reconfigure.cpp       |  3 ++-\n test/camera/capture.cpp                  |  3 ++-\n test/event-dispatcher.cpp                |  9 ++++---\n test/event.cpp                           | 11 +++++----\n test/fence.cpp                           |  6 ++---\n test/hotplug-cameras.cpp                 |  5 ++--\n test/ipa/ipa_interface_test.cpp          |  9 ++++---\n test/ipc/unixsocket.cpp                  |  5 ++--\n test/log/log_process.cpp                 |  5 ++--\n test/process/process_test.cpp            |  5 ++--\n test/timer-thread.cpp                    |  7 +++---\n test/timer.cpp                           | 31 ++++++++++++------------\n test/v4l2_videodevice/buffer_sharing.cpp |  3 ++-\n test/v4l2_videodevice/capture_async.cpp  |  3 ++-\n test/v4l2_videodevice/v4l2_m2mdevice.cpp |  5 ++--\n 19 files changed, 67 insertions(+), 61 deletions(-)\n\n\nbase-commit: a8284e3570de133960458c5703e75dc9e8e737c8","diff":"diff --git a/include/libcamera/base/timer.h b/include/libcamera/base/timer.h\nindex 09f1d3229bd5..759b68ada1e8 100644\n--- a/include/libcamera/base/timer.h\n+++ b/include/libcamera/base/timer.h\n@@ -25,7 +25,6 @@ public:\n \tTimer(Object *parent = nullptr);\n \t~Timer();\n \n-\tvoid start(unsigned int msec) { start(std::chrono::milliseconds(msec)); }\n \tvoid start(std::chrono::milliseconds duration);\n \tvoid start(std::chrono::steady_clock::time_point deadline);\n \tvoid stop();\ndiff --git a/src/libcamera/base/timer.cpp b/src/libcamera/base/timer.cpp\nindex 187336e3a1a4..74b060af32ff 100644\n--- a/src/libcamera/base/timer.cpp\n+++ b/src/libcamera/base/timer.cpp\n@@ -62,16 +62,6 @@ Timer::~Timer()\n \tstop();\n }\n \n-/**\n- * \\fn Timer::start(unsigned int msec)\n- * \\brief Start or restart the timer with a timeout of \\a msec\n- * \\param[in] msec The timer duration in milliseconds\n- *\n- * If the timer is already running it will be stopped and restarted.\n- *\n- * \\context This function is \\threadbound.\n- */\n-\n /**\n  * \\brief Start or restart the timer with a timeout of \\a duration\n  * \\param[in] duration The timer duration in milliseconds\ndiff --git a/src/libcamera/ipc_pipe_unixsocket.cpp b/src/libcamera/ipc_pipe_unixsocket.cpp\nindex 3ef907090131..da2cffc3b149 100644\n--- a/src/libcamera/ipc_pipe_unixsocket.cpp\n+++ b/src/libcamera/ipc_pipe_unixsocket.cpp\n@@ -18,6 +18,8 @@\n #include \"libcamera/internal/ipc_unixsocket.h\"\n #include \"libcamera/internal/process.h\"\n \n+using namespace std::chrono_literals;\n+\n namespace libcamera {\n \n LOG_DECLARE_CATEGORY(IPCPipe)\n@@ -126,7 +128,7 @@ int IPCPipeUnixSocket::call(const IPCUnixSocket::Payload &message,\n \t}\n \n \t/* \\todo Make this less dangerous, see IPCPipe::sendSync() */\n-\ttimeout.start(2000);\n+\ttimeout.start(2000ms);\n \twhile (!iter->second.done) {\n \t\tif (!timeout.isRunning()) {\n \t\t\tLOG(IPCPipe, Error) << \"Call timeout!\";\ndiff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp\nindex c504ea09e64b..9288400474a7 100644\n--- a/test/camera/buffer_import.cpp\n+++ b/test/camera/buffer_import.cpp\n@@ -25,6 +25,7 @@\n #include \"test.h\"\n \n using namespace libcamera;\n+using namespace std::chrono_literals;\n \n namespace {\n \n@@ -135,7 +136,7 @@ protected:\n \t\tEventDispatcher *dispatcher = Thread::current()->eventDispatcher();\n \n \t\tTimer timer;\n-\t\ttimer.start(1000);\n+\t\ttimer.start(1000ms);\n \t\twhile (timer.isRunning())\n \t\t\tdispatcher->processEvents();\n \ndiff --git a/test/camera/camera_reconfigure.cpp b/test/camera/camera_reconfigure.cpp\nindex 0fd8ab70d561..f6076baa0a31 100644\n--- a/test/camera/camera_reconfigure.cpp\n+++ b/test/camera/camera_reconfigure.cpp\n@@ -23,6 +23,7 @@\n \n using namespace libcamera;\n using namespace std;\n+using namespace std::chrono_literals;\n \n namespace {\n \n@@ -117,7 +118,7 @@ private:\n \t\tEventDispatcher *dispatcher = Thread::current()->eventDispatcher();\n \n \t\tTimer timer;\n-\t\ttimer.start(100);\n+\t\ttimer.start(100ms);\n \t\twhile (timer.isRunning())\n \t\t\tdispatcher->processEvents();\n \ndiff --git a/test/camera/capture.cpp b/test/camera/capture.cpp\nindex f3824f95cbd3..de824083dfed 100644\n--- a/test/camera/capture.cpp\n+++ b/test/camera/capture.cpp\n@@ -18,6 +18,7 @@\n \n using namespace libcamera;\n using namespace std;\n+using namespace std::chrono_literals;\n \n namespace {\n \n@@ -137,7 +138,7 @@ protected:\n \t\tEventDispatcher *dispatcher = Thread::current()->eventDispatcher();\n \n \t\tTimer timer;\n-\t\ttimer.start(1000);\n+\t\ttimer.start(1000ms);\n \t\twhile (timer.isRunning())\n \t\t\tdispatcher->processEvents();\n \ndiff --git a/test/event-dispatcher.cpp b/test/event-dispatcher.cpp\nindex 1cc17b045ec0..9b07ab2b61d7 100644\n--- a/test/event-dispatcher.cpp\n+++ b/test/event-dispatcher.cpp\n@@ -16,8 +16,9 @@\n \n #include \"test.h\"\n \n-using namespace std;\n using namespace libcamera;\n+using namespace std;\n+using namespace std::chrono_literals;\n \n static EventDispatcher *dispatcher;\n static bool interrupt;\n@@ -50,7 +51,7 @@ protected:\n \t\t/* Event processing interruption by signal. */\n \t\tstd::chrono::steady_clock::time_point start = std::chrono::steady_clock::now();\n \n-\t\ttimer.start(1000);\n+\t\ttimer.start(1000ms);\n \n \t\tstruct itimerval itimer = {};\n \t\titimer.it_value.tv_usec = 500000;\n@@ -69,7 +70,7 @@ protected:\n \t\t}\n \n \t\t/* Event processing interruption. */\n-\t\ttimer.start(1000);\n+\t\ttimer.start(1000ms);\n \t\tdispatcher->interrupt();\n \n \t\tdispatcher->processEvents();\n@@ -79,7 +80,7 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\ttimer.start(1000);\n+\t\ttimer.start(1000ms);\n \t\titimer.it_value.tv_usec = 500000;\n \t\tinterrupt = true;\n \t\tsetitimer(ITIMER_REAL, &itimer, nullptr);\ndiff --git a/test/event.cpp b/test/event.cpp\nindex d4765eb14d12..19dceae123dd 100644\n--- a/test/event.cpp\n+++ b/test/event.cpp\n@@ -16,8 +16,9 @@\n \n #include \"test.h\"\n \n-using namespace std;\n using namespace libcamera;\n+using namespace std;\n+using namespace std::chrono_literals;\n \n class EventTest : public Test\n {\n@@ -55,7 +56,7 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\ttimeout.start(100);\n+\t\ttimeout.start(100ms);\n \t\tdispatcher->processEvents();\n \t\ttimeout.stop();\n \n@@ -67,7 +68,7 @@ protected:\n \t\t/* Test read notification without data. */\n \t\tnotified_ = false;\n \n-\t\ttimeout.start(100);\n+\t\ttimeout.start(100ms);\n \t\tdispatcher->processEvents();\n \t\ttimeout.stop();\n \n@@ -86,7 +87,7 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\ttimeout.start(100);\n+\t\ttimeout.start(100ms);\n \t\tdispatcher->processEvents();\n \t\ttimeout.stop();\n \n@@ -99,7 +100,7 @@ protected:\n \t\tnotified_ = false;\n \t\tnotifier_->setEnabled(true);\n \n-\t\ttimeout.start(100);\n+\t\ttimeout.start(100ms);\n \t\tdispatcher->processEvents();\n \t\ttimeout.stop();\n \ndiff --git a/test/fence.cpp b/test/fence.cpp\nindex 524db2a10757..1e38bc2f8790 100644\n--- a/test/fence.cpp\n+++ b/test/fence.cpp\n@@ -22,9 +22,9 @@\n #include \"camera_test.h\"\n #include \"test.h\"\n \n-using namespace std::chrono_literals;\n using namespace libcamera;\n using namespace std;\n+using namespace std::chrono_literals;\n \n class FenceTest : public CameraTest, public Test\n {\n@@ -316,7 +316,7 @@ int FenceTest::run()\n \n \t/* Loop for one second. */\n \tTimer timer;\n-\ttimer.start(1000);\n+\ttimer.start(1000ms);\n \twhile (timer.isRunning() && expectedCompletionResult_) {\n \t\tif (completedRequest_ == signalledRequestId_ && setFence_)\n \t\t\t/*\n@@ -324,7 +324,7 @@ int FenceTest::run()\n \t\t\t * been re-queued with a fence. Start the timer to\n \t\t\t * signal the fence in 10 msec.\n \t\t\t */\n-\t\t\tfenceTimer.start(10);\n+\t\t\tfenceTimer.start(10ms);\n \n \t\tdispatcher_->processEvents();\n \t}\ndiff --git a/test/hotplug-cameras.cpp b/test/hotplug-cameras.cpp\nindex df56040350c5..5d9260a241ec 100644\n--- a/test/hotplug-cameras.cpp\n+++ b/test/hotplug-cameras.cpp\n@@ -22,6 +22,7 @@\n #include \"test.h\"\n \n using namespace libcamera;\n+using namespace std::chrono_literals;\n \n class HotplugTest : public Test\n {\n@@ -88,7 +89,7 @@ protected:\n \t\tstd::ofstream(uvcDriverDir_ + \"unbind\", std::ios::binary)\n \t\t\t<< uvcDeviceDir;\n \t\tTimer timer;\n-\t\ttimer.start(1000);\n+\t\ttimer.start(1000ms);\n \t\twhile (timer.isRunning() && !cameraRemoved_)\n \t\t\tThread::current()->eventDispatcher()->processEvents();\n \t\tif (!cameraRemoved_) {\n@@ -99,7 +100,7 @@ protected:\n \t\t/* Bind the camera again and process events. */\n \t\tstd::ofstream(uvcDriverDir_ + \"bind\", std::ios::binary)\n \t\t\t<< uvcDeviceDir;\n-\t\ttimer.start(1000);\n+\t\ttimer.start(1000ms);\n \t\twhile (timer.isRunning() && !cameraAdded_)\n \t\t\tThread::current()->eventDispatcher()->processEvents();\n \t\tif (!cameraAdded_) {\ndiff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp\nindex 43562e608506..3c0df843ea61 100644\n--- a/test/ipa/ipa_interface_test.cpp\n+++ b/test/ipa/ipa_interface_test.cpp\n@@ -27,8 +27,9 @@\n \n #include \"test.h\"\n \n-using namespace std;\n using namespace libcamera;\n+using namespace std;\n+using namespace std::chrono_literals;\n \n class IPAInterfaceTest : public Test, public Object\n {\n@@ -111,7 +112,7 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\ttimer.start(1000);\n+\t\ttimer.start(1000ms);\n \t\twhile (timer.isRunning() && trace_ != ipa::vimc::IPAOperationInit)\n \t\t\tdispatcher->processEvents();\n \n@@ -123,7 +124,7 @@ protected:\n \n \t\t/* Test start of IPA module. */\n \t\tipa_->start();\n-\t\ttimer.start(1000);\n+\t\ttimer.start(1000ms);\n \t\twhile (timer.isRunning() && trace_ != ipa::vimc::IPAOperationStart)\n \t\t\tdispatcher->processEvents();\n \n@@ -134,7 +135,7 @@ protected:\n \n \t\t/* Test stop of IPA module. */\n \t\tipa_->stop();\n-\t\ttimer.start(1000);\n+\t\ttimer.start(1000ms);\n \t\twhile (timer.isRunning() && trace_ != ipa::vimc::IPAOperationStop)\n \t\t\tdispatcher->processEvents();\n \ndiff --git a/test/ipc/unixsocket.cpp b/test/ipc/unixsocket.cpp\nindex 7e90e629e9ac..304e613bc984 100644\n--- a/test/ipc/unixsocket.cpp\n+++ b/test/ipc/unixsocket.cpp\n@@ -30,8 +30,9 @@\n #define CMD_LEN_CMP\t3\n #define CMD_JOIN\t4\n \n-using namespace std;\n using namespace libcamera;\n+using namespace std;\n+using namespace std::chrono_literals;\n \n int calculateLength(int fd)\n {\n@@ -430,7 +431,7 @@ private:\n \t\tif (ret)\n \t\t\treturn ret;\n \n-\t\ttimeout.start(200);\n+\t\ttimeout.start(200ms);\n \t\twhile (!callDone_) {\n \t\t\tif (!timeout.isRunning()) {\n \t\t\t\tcerr << \"Call timeout!\" << endl;\ndiff --git a/test/log/log_process.cpp b/test/log/log_process.cpp\nindex 2484c58f2fa9..966b80cf3af7 100644\n--- a/test/log/log_process.cpp\n+++ b/test/log/log_process.cpp\n@@ -26,8 +26,9 @@\n \n #include \"test.h\"\n \n-using namespace std;\n using namespace libcamera;\n+using namespace std;\n+using namespace std::chrono_literals;\n \n static const string message(\"hello from the child\");\n \n@@ -80,7 +81,7 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\ttimeout.start(200);\n+\t\ttimeout.start(200ms);\n \t\twhile (timeout.isRunning())\n \t\t\tdispatcher->processEvents();\n \ndiff --git a/test/process/process_test.cpp b/test/process/process_test.cpp\nindex b410756b3288..cb6940c6a7db 100644\n--- a/test/process/process_test.cpp\n+++ b/test/process/process_test.cpp\n@@ -18,8 +18,9 @@\n \n #include \"test.h\"\n \n-using namespace std;\n using namespace libcamera;\n+using namespace std;\n+using namespace std::chrono_literals;\n \n class ProcessTestChild\n {\n@@ -61,7 +62,7 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\ttimeout.start(2000);\n+\t\ttimeout.start(2000ms);\n \t\twhile (timeout.isRunning() && exitStatus_ == Process::NotExited)\n \t\t\tdispatcher->processEvents();\n \ndiff --git a/test/timer-thread.cpp b/test/timer-thread.cpp\nindex f7e8743da9e6..618217538779 100644\n--- a/test/timer-thread.cpp\n+++ b/test/timer-thread.cpp\n@@ -14,8 +14,9 @@\n \n #include \"test.h\"\n \n-using namespace std;\n using namespace libcamera;\n+using namespace std;\n+using namespace std::chrono_literals;\n \n class TimeoutHandler : public Object\n {\n@@ -24,13 +25,13 @@ public:\n \t\t: timer_(this), timeout_(false)\n \t{\n \t\ttimer_.timeout.connect(this, &TimeoutHandler::timeoutHandler);\n-\t\ttimer_.start(100);\n+\t\ttimer_.start(100ms);\n \t}\n \n \tvoid restart()\n \t{\n \t\ttimeout_ = false;\n-\t\ttimer_.start(100);\n+\t\ttimer_.start(100ms);\n \t}\n \n \tbool timeout() const\ndiff --git a/test/timer.cpp b/test/timer.cpp\nindex be79d0100a58..0f01c3cb00ea 100644\n--- a/test/timer.cpp\n+++ b/test/timer.cpp\n@@ -14,8 +14,9 @@\n \n #include \"test.h\"\n \n-using namespace std;\n using namespace libcamera;\n+using namespace std;\n+using namespace std::chrono_literals;\n \n class ManagedTimer : public Timer\n {\n@@ -26,7 +27,7 @@ public:\n \t\ttimeout.connect(this, &ManagedTimer::timeoutHandler);\n \t}\n \n-\tvoid start(int msec)\n+\tvoid start(std::chrono::milliseconds msec)\n \t{\n \t\tcount_ = 0;\n \t\tstart_ = std::chrono::steady_clock::now();\n@@ -82,7 +83,7 @@ protected:\n \t\tManagedTimer timer2;\n \n \t\t/* Timer expiration. */\n-\t\ttimer.start(1000);\n+\t\ttimer.start(1000ms);\n \n \t\tif (!timer.isRunning()) {\n \t\t\tcout << \"Timer expiration test failed\" << endl;\n@@ -101,7 +102,7 @@ protected:\n \t\t * Nanosecond resolution in a 32 bit value wraps at 4.294967\n \t\t * seconds (0xFFFFFFFF / 1000000)\n \t\t */\n-\t\ttimer.start(4295);\n+\t\ttimer.start(4295ms);\n \t\tdispatcher->processEvents();\n \n \t\tif (timer.hasFailed()) {\n@@ -110,7 +111,7 @@ protected:\n \t\t}\n \n \t\t/* Timer restart. */\n-\t\ttimer.start(500);\n+\t\ttimer.start(500ms);\n \n \t\tif (!timer.isRunning()) {\n \t\t\tcout << \"Timer restart test failed\" << endl;\n@@ -125,9 +126,9 @@ protected:\n \t\t}\n \n \t\t/* Timer restart before expiration. */\n-\t\ttimer.start(50);\n-\t\ttimer.start(100);\n-\t\ttimer.start(150);\n+\t\ttimer.start(50ms);\n+\t\ttimer.start(100ms);\n+\t\ttimer.start(150ms);\n \n \t\tdispatcher->processEvents();\n \n@@ -147,8 +148,8 @@ protected:\n \t\t}\n \n \t\t/* Two timers. */\n-\t\ttimer.start(1000);\n-\t\ttimer2.start(300);\n+\t\ttimer.start(1000ms);\n+\t\ttimer2.start(300ms);\n \n \t\tdispatcher->processEvents();\n \n@@ -170,8 +171,8 @@ protected:\n \t\t}\n \n \t\t/* Restart timer before expiration. */\n-\t\ttimer.start(1000);\n-\t\ttimer2.start(300);\n+\t\ttimer.start(1000ms);\n+\t\ttimer2.start(300ms);\n \n \t\tdispatcher->processEvents();\n \n@@ -180,7 +181,7 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\ttimer.start(1000);\n+\t\ttimer.start(1000ms);\n \n \t\tdispatcher->processEvents();\n \n@@ -194,10 +195,10 @@ protected:\n \t\t * deleted. This will result in a crash on failure.\n \t\t */\n \t\tManagedTimer *dyntimer = new ManagedTimer();\n-\t\tdyntimer->start(100);\n+\t\tdyntimer->start(100ms);\n \t\tdelete dyntimer;\n \n-\t\ttimer.start(200);\n+\t\ttimer.start(200ms);\n \t\tdispatcher->processEvents();\n \n \t\treturn TestPass;\ndiff --git a/test/v4l2_videodevice/buffer_sharing.cpp b/test/v4l2_videodevice/buffer_sharing.cpp\nindex 75ee93ce5261..fa856ab6b5a8 100644\n--- a/test/v4l2_videodevice/buffer_sharing.cpp\n+++ b/test/v4l2_videodevice/buffer_sharing.cpp\n@@ -21,6 +21,7 @@\n #include \"v4l2_videodevice_test.h\"\n \n using namespace libcamera;\n+using namespace std::chrono_literals;\n \n class BufferSharingTest : public V4L2VideoDeviceTest\n {\n@@ -145,7 +146,7 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\ttimeout.start(10000);\n+\t\ttimeout.start(10000ms);\n \t\twhile (timeout.isRunning()) {\n \t\t\tdispatcher->processEvents();\n \t\t\tif (framesCaptured_ > 30 && framesOutput_ > 30)\ndiff --git a/test/v4l2_videodevice/capture_async.cpp b/test/v4l2_videodevice/capture_async.cpp\nindex 3aa4ca0b6955..42e1e671790b 100644\n--- a/test/v4l2_videodevice/capture_async.cpp\n+++ b/test/v4l2_videodevice/capture_async.cpp\n@@ -16,6 +16,7 @@\n #include \"v4l2_videodevice_test.h\"\n \n using namespace libcamera;\n+using namespace std::chrono_literals;\n \n class CaptureAsyncTest : public V4L2VideoDeviceTest\n {\n@@ -60,7 +61,7 @@ protected:\n \t\tif (ret)\n \t\t\treturn TestFail;\n \n-\t\ttimeout.start(10000);\n+\t\ttimeout.start(10000ms);\n \t\twhile (timeout.isRunning()) {\n \t\t\tdispatcher->processEvents();\n \t\t\tif (frames > 30)\ndiff --git a/test/v4l2_videodevice/v4l2_m2mdevice.cpp b/test/v4l2_videodevice/v4l2_m2mdevice.cpp\nindex ebf3e245f86b..852b853fa81a 100644\n--- a/test/v4l2_videodevice/v4l2_m2mdevice.cpp\n+++ b/test/v4l2_videodevice/v4l2_m2mdevice.cpp\n@@ -19,8 +19,9 @@\n \n #include \"test.h\"\n \n-using namespace std;\n using namespace libcamera;\n+using namespace std;\n+using namespace std::chrono_literals;\n \n class V4L2M2MDeviceTest : public Test\n {\n@@ -155,7 +156,7 @@ protected:\n \t\t}\n \n \t\tTimer timeout;\n-\t\ttimeout.start(5000);\n+\t\ttimeout.start(5000ms);\n \t\twhile (timeout.isRunning()) {\n \t\t\tdispatcher->processEvents();\n \t\t\tif (captureFrames_ > 30)\n","prefixes":["libcamera-devel"]}