1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 08:39:46 +02:00

1991: On Windows, nyquist effects and analysers slower than on 2.2.2

Problem: profiled the limiter effect, and found that wxGetLocalTimeMillis() in ProgressDilaog::Update was taking up a lot of time.
The slow down of the nyquist effects and analysers was introduced by the switch to wxWidgets 3.1.1, so presumably there was some change to the implementation of wxGetLocalTimeMillis()

Fix: Use wxGetUTCTimeMillis() instead of wxLocalTimeMillis() in ProgressDialog.cpp. This is much faster on Windows, and wxWidgets recommend its use to due wxGetLocalTimeMillis() being affected by start/end summer time (daylight saving time).
This commit is contained in:
David Bailes 2018-10-03 19:08:09 +01:00
parent 0a55b27d2d
commit 348e7868b8

View File

@ -1075,7 +1075,7 @@ void ProgressDialog::Reinit()
{
mLastValue = 0;
mStartTime = wxGetLocalTimeMillis().GetValue();
mStartTime = wxGetUTCTimeMillis().GetValue();
mLastUpdate = mStartTime;
mYieldTimer = mStartTime;
mCancel = false;
@ -1326,7 +1326,7 @@ ProgressResult ProgressDialog::Update(int value, const wxString & message)
return ProgressResult::Stopped;
}
wxLongLong_t now = wxGetLocalTimeMillis().GetValue();
wxLongLong_t now = wxGetUTCTimeMillis().GetValue();
wxLongLong_t elapsed = now - mStartTime;
if (elapsed < 500)
@ -1586,7 +1586,7 @@ void ProgressDialog::Beep() const
gPrefs->Read(wxT("/GUI/BeepAfterDuration"), &after, 60);
gPrefs->Read(wxT("/GUI/BeepFileName"), &name, wxEmptyString);
if (should && wxGetLocalTimeMillis().GetValue() - mStartTime > after * 1000)
if (should && wxGetUTCTimeMillis().GetValue() - mStartTime > after * 1000)
{
wxBusyCursor busy;
wxSound s;
@ -1656,7 +1656,7 @@ ProgressResult TimerProgressDialog::UpdateProgress()
return ProgressResult::Stopped;
}
wxLongLong_t now = wxGetLocalTimeMillis().GetValue();
wxLongLong_t now = wxGetUTCTimeMillis().GetValue();
wxLongLong_t elapsed = now - mStartTime;
if (elapsed < 500)