Chrome Version: 73.0.3680.0 (Developer Build) (64-bit)
OS: Linux
What steps will reproduce the problem?(1) Execute the following codes:
const mark = performance.mark("A")
const measure = performance.measure("M", undefined, "A");
console.log("mark.startTime="+mark.startTime);
console.log("measure.endTime="+measure.endTime);
(2) Observe whether the two results are equal.
What is the expected result?
The result should be equal. According to the spec https://w3c.github.io/user-timing/#measure-method, the end time of the measure-entry "M" should be the mark-entry "A"'s start time:
"Compute end time as follows:
If endMark is present, let end time be the value returned by running the convert a mark to a timestamp algorithm passing in endMark."
What happens instead?
The two time's are different.
Please use labels and text to provide additional information.
The culprit seems to be this line:
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/timing/performance_user_timing.cc?q=usertiming+package:%5Echromium$&dr=CSs&l=217
---------------------------------------
if (start.IsNull()) {
end_time = performance_->now();
}
---------------------------------------
These lines stem back to 2012. It's surprising that nobody has discovered it.
Chrome Version: 73.0.3680.0 (Developer Build) (64-bit)
OS: Linux
What steps will reproduce the problem?(1) Execute the following codes:
const mark = performance.mark("A")
const measure = performance.measure("M", undefined, "A");
console.log("mark.startTime="+mark.startTime);
console.log("measure.endTime="+measure.endTime);
(2) Observe whether the two results are equal.
What is the expected result?
The result should be equal. According to the spec https://w3c.github.io/user-timing/#measure-method, the end time of the measure-entry "M" should be the mark-entry "A"'s start time:
"Compute end time as follows:
If endMark is present, let end time be the value returned by running the convert a mark to a timestamp algorithm passing in endMark."
What happens instead?
The two time are different.
Please use labels and text to provide additional information.
The culprit seems to be this line:
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/timing/performance_user_timing.cc?q=usertiming+package:%5Echromium$&dr=CSs&l=217
---------------------------------------
if (start.IsNull()) {
end_time = performance_->now();
}
---------------------------------------
These lines stem back to 2012. It's surprising that nobody has discovered it.
Chrome Version: 73.0.3680.0 (Developer Build) (64-bit)
OS: Linux
What steps will reproduce the problem?(1) Execute the following codes:
const mark = performance.mark("A")
const measure = performance.measure("M", undefined, "A");
console.log("mark.startTime="+mark.startTime);
console.log("measure's end="+(measure.start + measure.duration));
(2) Observe whether the two results are equal.
What is the expected result?
The result should be equal. According to the spec https://w3c.github.io/user-timing/#measure-method, the end time of the measure-entry "M" should be the mark-entry "A"'s start time:
"Compute end time as follows:
If endMark is present, let end time be the value returned by running the convert a mark to a timestamp algorithm passing in endMark."
What happens instead?
The two time are different.
Please use labels and text to provide additional information.
The culprit seems to be this line:
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/timing/performance_user_timing.cc?q=usertiming+package:%5Echromium$&dr=CSs&l=217
---------------------------------------
if (start.IsNull()) {
end_time = performance_->now();
}
---------------------------------------
These lines stem back to 2012. It's surprising that nobody has discovered it.
Chrome Version: 73.0.3680.0 (Developer Build) (64-bit)
OS: Linux
What steps will reproduce the problem?(1) Execute the following codes:
const endMark = performance.mark("endMark")
const measureEntry = performance.measure("measureEntry", undefined, "endMark");
console.log("endMark.startTime="+endMark.startTime);
console.log("measureEntry end="+(measureEntry.start + measureEntry.duration));
(2) Observe whether the two results are equal.
What is the expected result?
The result should be equal. According to the spec https://w3c.github.io/user-timing/#measure-method, |measureEntry|'s end should be |endMark|'s start time:
"Compute end time as follows:
If endMark is present, let end time be the value returned by running the convert a mark to a timestamp algorithm passing in endMark."
What happens instead?
The two time are different.
Please use labels and text to provide additional information.
The culprit seems to be this line:
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/timing/performance_user_timing.cc?q=usertiming+package:%5Echromium$&dr=CSs&l=217
---------------------------------------
if (start.IsNull()) {
end_time = performance_->now();
}
---------------------------------------
These lines stem back to 2012. It's surprising that nobody has discovered it.
Chrome Version: 73.0.3680.0 (Developer Build) (64-bit)
OS: Linux
What steps will reproduce the problem?(1) Execute the following codes:
const endMark = performance.mark("endMark")
const measureEntry = performance.measure("measureEntry", undefined, "endMark");
console.log("endMark.startTime="+endMark.startTime);
console.log("measureEntry end="+(measureEntry.start + measureEntry.duration));
(2) Observe whether the two results are equal.
What is the expected result?
The result should be equal. According to the spec https://w3c.github.io/user-timing/#measure-method, |measureEntry|'s end should be |endMark|'s start time:
"Compute end time as follows:
If endMark is present, let end time be the value returned by running the convert a mark to a timestamp algorithm passing in endMark."
What happens instead?
The two time are different.
Please use labels and text to provide additional information.
The culprit seems to be this line:
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/timing/performance_user_timing.cc?q=usertiming+package:%5Echromium$&dr=CSs&l=217
---------------------------------------
if (start.IsNull()) {
end_time = performance_->now();
}
---------------------------------------
These lines stem back to 2012.
Summary: [UserTiming] Measure API: when start is unset and end is set, the (start + duration) of the entry is not the set end (was: [UserTiming] When start is unset and end is set, end becomes now)
Summary: [UserTiming] Measure API: end mark is set correctly when start mark is absent (was: [UserTiming] Measure API: when start is unset and end is set, the (start + duration) of the entry is not the set end)
Summary: [UserTiming] Measure API: end mark is set incorrectly when start mark is absent (was: [UserTiming] Measure API: end mark is set correctly when start mark is absent)
Comment 1 by maxlg@chromium.org
, Yesterday (32 hours ago)