@@ -11,7 +11,8 @@ function getMockEvents(startTime, options = {}) {
1111 useLegacyHeaderFormat = false ,
1212 useMicroseconds = false ,
1313 } = options ;
14- const highResStartTime = startTime * ( useMicroseconds ? 1000 : 1 ) ;
14+ const timeMult = useMicroseconds ? 1000 : 1 ;
15+ const highResStartTime = startTime * timeMult ;
1516 const requestId = ( options . requestId || gRequestId ++ ) + "" ;
1617
1718 if ( useLegacyHeaderFormat ) {
@@ -39,7 +40,7 @@ function getMockEvents(startTime, options = {}) {
3940 request : requestId ,
4041 timings : {
4142 originTime : 0 ,
42- requestTime : highResStartTime + 50 ,
43+ requestTime : highResStartTime + 50 * timeMult ,
4344 redirectStart : 0 ,
4445 redirectEnd : 0 ,
4546 fetchStart : 0 ,
@@ -80,19 +81,19 @@ function getMockEvents(startTime, options = {}) {
8081 request : requestId ,
8182 timings : {
8283 originTime : 0 ,
83- requestTime : highResStartTime + 50 ,
84+ requestTime : highResStartTime + 50 * timeMult ,
8485 redirectStart : 0 ,
8586 redirectEnd : 0 ,
86- fetchStart : highResStartTime + 100 ,
87- dnsStart : highResStartTime + 150 ,
88- dnsEnd : highResStartTime + 200 ,
89- connectStart : highResStartTime + 300 ,
90- connectEnd : highResStartTime + 400 ,
91- tlsStart : highResStartTime + 500 ,
92- tlsEnd : highResStartTime + 600 ,
93- requestStart : highResStartTime + 700 ,
94- responseStart : highResStartTime + 800 ,
95- responseEnd : highResStartTime + 900 ,
87+ fetchStart : highResStartTime + 100 * timeMult ,
88+ dnsStart : highResStartTime + 150 * timeMult ,
89+ dnsEnd : highResStartTime + 200 * timeMult ,
90+ connectStart : highResStartTime + 300 * timeMult ,
91+ connectEnd : highResStartTime + 400 * timeMult ,
92+ tlsStart : highResStartTime + 500 * timeMult ,
93+ tlsEnd : highResStartTime + 600 * timeMult ,
94+ requestStart : highResStartTime + 700 * timeMult ,
95+ responseStart : highResStartTime + 800 * timeMult ,
96+ responseEnd : highResStartTime + 900 * timeMult ,
9697 } ,
9798 url : options . url || "https://example.com/" ,
9899 rawHeaders :
0 commit comments