diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qa/cppunit/timer.cxx | 16 | ||||
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 4 |
2 files changed, 6 insertions, 14 deletions
diff --git a/vcl/qa/cppunit/timer.cxx b/vcl/qa/cppunit/timer.cxx index 0d3afa1ace8d..07fdc92ffbac 100644 --- a/vcl/qa/cppunit/timer.cxx +++ b/vcl/qa/cppunit/timer.cxx @@ -14,6 +14,7 @@ #include <osl/thread.hxx> #include <salhelper/thread.hxx> +#include <chrono> #include <vcl/timer.hxx> #include <vcl/idle.hxx> @@ -39,10 +40,7 @@ public: } virtual void SAL_CALL run() override { - TimeValue aWait; - aWait.Seconds = mnSeconds; - aWait.Nanosec = 1000000; // +1ms - osl::Thread::wait( aWait ); + osl::Thread::wait( std::chrono::seconds(mnSeconds) ); fprintf(stderr, "ERROR: WatchDog timer thread expired, failing the test!\n"); fflush(stderr); CPPUNIT_ASSERT_MESSAGE("watchdog triggered", false); @@ -90,10 +88,7 @@ public: void TimerTest::testWatchdog() { // out-wait the watchdog. - TimeValue aWait; - aWait.Seconds = 12; - aWait.Nanosec = 0; - osl::Thread::wait( aWait ); + osl::Thread::wait( std::chrono::seconds(12) ); } #endif @@ -339,10 +334,7 @@ public: } virtual void Invoke() override { - TimeValue aWait; - aWait.Seconds = 1; - aWait.Nanosec = 0; - osl::Thread::wait( aWait ); + osl::Thread::wait( std::chrono::seconds(1) ); mbSlow = true; } }; diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 7f920c0370b7..3da890ae4e2e 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -8,6 +8,7 @@ */ #include <config_opengl.h> +#include <chrono> #include <vcl/opengl/OpenGLContext.hxx> #include <vcl/opengl/OpenGLHelper.hxx> @@ -1543,8 +1544,7 @@ void OpenGLContext::swapBuffers() if (bSleep) { // half a second. - TimeValue aSleep( 0, 500*1000*1000 ); - osl::Thread::wait( aSleep ); + osl::Thread::wait( std::chrono::milliseconds(500) ); } } |