mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Added async performance test
This commit is contained in:
parent
363f590019
commit
7aa3350d45
9 changed files with 122 additions and 17 deletions
22
etc/ci/performance/harness/harness.js
Normal file
22
etc/ci/performance/harness/harness.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
window.customTimers = {};
|
||||
// Create a custome timestamp with a custom name
|
||||
function mark(name) {
|
||||
if (window.performance) {
|
||||
// performance.now() is the time after navigationStart
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Performance/now
|
||||
var time = performance.now() + performance.timing.navigationStart;
|
||||
}
|
||||
else {
|
||||
var time = (new Date()).getTime();
|
||||
}
|
||||
window.customTimers[name] = time;
|
||||
}
|
||||
|
||||
// Notifying the test harness that the test has ended, otherwise the test
|
||||
// harness will time out
|
||||
function done() {
|
||||
var elem = document.createElement('span')
|
||||
elem.id = "GECKO_TEST_DONE";
|
||||
document.body.appendChild(elem);
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue