Bug 1757668 - Use TimeDuration::ToMicroseconds() in TimerThread::Run(). r=sefeng,nika

Modify the code so that instead of getting microseconds by first
getting milliseconds, then multiplying by 1000, it retrieves the
microseconds value directly.

Differential Revision: https://phabricator.services.mozilla.com/D143472
This commit is contained in:
Razvan Cojocaru 2022-04-12 19:39:48 +00:00
parent dcf8390dc0
commit 80c01fc4fe

View File

@ -452,7 +452,7 @@ TimerThread::Run() {
// resolution. We use mAllowedEarlyFiringMicroseconds, calculated
// before, to do the optimal rounding (i.e., of how to decide what
// interval is so small we should not wait at all).
double microseconds = (timeout - now).ToMilliseconds() * 1000;
double microseconds = (timeout - now).ToMicroseconds();
if (ChaosMode::isActive(ChaosFeature::TimerScheduling)) {
// The mean value of sFractions must be 1 to ensure that