diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-11-25 21:06:59 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-11-25 23:04:58 +0000 |
commit | 458f01c577c5340e07b345d228fe3d847cc6a5b1 (patch) | |
tree | c67827ded61ab31409ca1b21088cc4a1e5ad37b3 /vcl | |
parent | 55d0a5e43c968798fe52587f9dae256d94e9ce53 (diff) |
vcl: timer - avoid expensive and pointless re-fetch of current time.
Change-Id: I1423de820ec40340d2ddb9030106b813e488f2f3
Reviewed-on: https://gerrit.libreoffice.org/20184
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/timer.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/vcl/source/app/timer.cxx b/vcl/source/app/timer.cxx index f5ec1b2901ea..cb00fabb4efb 100644 --- a/vcl/source/app/timer.cxx +++ b/vcl/source/app/timer.cxx @@ -38,7 +38,6 @@ bool Timer::ReadyForSchedule( bool /* bTimerOnly */ ) const sal_uInt64 Timer::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) const { - const sal_uInt64 nNewTime = tools::Time::GetSystemTicks(); sal_uInt64 nDeltaTime; //determine smallest time slot if( mpSchedulerData->mnUpdateTime == nTime ) @@ -50,11 +49,11 @@ sal_uInt64 Timer::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) con else { nDeltaTime = mpSchedulerData->mnUpdateTime + mnTimeout; - if( nDeltaTime < nNewTime ) + if( nDeltaTime < nTime ) nMinPeriod = ImmediateTimeoutMs; else { - nDeltaTime -= nNewTime; + nDeltaTime -= nTime; if( nDeltaTime < nMinPeriod ) nMinPeriod = nDeltaTime; } |