window.performance.timing
This property has a PerformanceTiming
object describing your page.
PerformanceTiming.domContentLoadedEventStart
The PerformanceTiming.domContentLoadedEventStart
property has a value representing the moment right before the parser sent the DOMContentLoaded
event, in miliseconds since the UNIX epoch.
DOMContentLoaded
event
The DOMContentLoaded
event is fired when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.
The reason why window.performance.timing.domContentLoadedEventStart
gave you 0
Your script was executed before the DOMContentLoaded
event occurred, so the moment right before the parser sent the DOMContentLoaded
event, was unknown at that time.

To prevent it
To prevent PerformanceTiming.domContentLoadedEventStart
from being 0
, you have to refer it after the DOMContentLoaded
event occurs. Try this one:
document.addEventListener("DOMContentLoaded", event => {
console.info("DOM fully loaded and parsed.");
console.info(window.performance.timing.domContentLoadedEventStart);
});
or
<script defer src="...">
.