MCPcopy Create free account
hub / github.com/nodejs/node / markTime

Function markTime

test/fixtures/wpt/hr-time/resources/unload.js:9–22  ·  view source on GitHub ↗
(docName, lifecycleEventName)

Source from the content-addressed store, hash-verified

7};
8
9const markTime = (docName, lifecycleEventName) => {
10 // Calculating these values before the below `mark` invocation ensures that delays in
11 // reaching across to the other window object doesn't interfere with the correctness
12 // of the test.
13 const dateNow = Date.now();
14 const performanceNow = performance.now();
15
16 window.opener.mark({
17 docName,
18 lifecycleEventName,
19 performanceNow: performanceNow,
20 dateNow: dateNow
21 });
22};
23
24const setupUnloadPrompt = (docName, msg) => {
25 window.addEventListener("beforeunload", ev => {

Callers 2

setupUnloadPromptFunction · 0.85
setupListenersFunction · 0.85

Calls 2

nowMethod · 0.80
markMethod · 0.45

Tested by

no test coverage detected