File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -159,8 +159,10 @@ void MarkGarbageCollectionEnd(
159159 if (LIKELY (!state->observers [NODE_PERFORMANCE_ENTRY_TYPE_GC]))
160160 return ;
161161
162- double start_time = state->performance_last_gc_start_mark / 1e6 ;
163- double duration = (PERFORMANCE_NOW () / 1e6 ) - start_time;
162+ double start_time =
163+ (state->performance_last_gc_start_mark - timeOrigin) / 1e6 ;
164+ double duration =
165+ (PERFORMANCE_NOW () / 1e6 ) - (state->performance_last_gc_start_mark / 1e6 );
164166
165167 std::unique_ptr<GCPerformanceEntry> entry =
166168 std::make_unique<GCPerformanceEntry>(
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ const kinds = [
3535 assert . strictEqual ( entry . flags , NODE_PERFORMANCE_GC_FLAGS_FORCED ) ;
3636 assert . strictEqual ( entry . detail . flags , NODE_PERFORMANCE_GC_FLAGS_FORCED ) ;
3737 assert . strictEqual ( typeof entry . startTime , 'number' ) ;
38+ assert ( entry . startTime < 1e4 , 'startTime should be relative to performance.timeOrigin.' ) ;
3839 assert . strictEqual ( typeof entry . duration , 'number' ) ;
3940 obs . disconnect ( ) ;
4041 } ) ) ;
You can’t perform that action at this time.
0 commit comments