| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -159,8 +159,10 @@ void MarkGarbageCollectionEnd( | |||
| 159 | 159 | if (LIKELY(!state->observers[NODE_PERFORMANCE_ENTRY_TYPE_GC])) | |
| 160 | 160 | return; | |
| 161 | 161 | ||
| 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); | ||
| 164 | 166 | ||
| 165 | 167 | std::unique_ptr<GCPerformanceEntry> entry = | |
| 166 | 168 | std::make_unique<GCPerformanceEntry>( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,6 +35,7 @@ const kinds = [ | |||
| 35 | 35 | assert.strictEqual(entry.flags, NODE_PERFORMANCE_GC_FLAGS_FORCED); | |
| 36 | 36 | assert.strictEqual(entry.detail.flags, NODE_PERFORMANCE_GC_FLAGS_FORCED); | |
| 37 | 37 | assert.strictEqual(typeof entry.startTime, 'number'); | |
| 38 | + assert(entry.startTime < 1e4, 'startTime should be relative to performance.timeOrigin.'); | ||
| 38 | 39 | assert.strictEqual(typeof entry.duration, 'number'); | |
| 39 | 40 | obs.disconnect(); | |
| 40 | 41 | })); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments