File tree 1 file changed +5
-1
lines changed
toolkit/components/processtools
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 13
13
#include < windows.h>
14
14
#include < psapi.h>
15
15
#include < winternl.h>
16
+ #include < xpcpublic.h>
16
17
17
18
#ifndef STATUS_INFO_LENGTH_MISMATCH
18
19
# define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L )
@@ -34,7 +35,10 @@ static uint64_t ToNanoSeconds(const FILETIME& aFileTime) {
34
35
int GetCycleTimeFrequencyMHz () {
35
36
static const int frequency = []() {
36
37
// Having a constant TSC is required to convert cycle time to actual time.
37
- if (!mozilla::has_constant_tsc ()) {
38
+ // In automation, having short CPU times reported as 0 is more of a problem
39
+ // than having an imprecise value. The fallback method can't report CPU
40
+ // times < 1/64s.
41
+ if (!mozilla::has_constant_tsc () && !xpc::IsInAutomation ()) {
38
42
return 0 ;
39
43
}
40
44
You can’t perform that action at this time.
0 commit comments