Lighthouse does it slightly different. https://github.com/GoogleChrome/lighthouse/blob/458ded802cc48c2b92f07433ef8aa29eb5fbb53d/core/computed/resource-summary.js#L66
Btw: I am not just using lighthouse results because I want to approximate the dataReloadRatio and Lighthouse doesn't seem to offer measurements for that. To stay consistent with the measurement I use puppeteer and chrome dev protocol for all measurements.