Read benchmark warm up time and recording time from uri

This commit is contained in:
Michael "Z" Goddard 2018-01-08 15:34:58 -05:00
parent 980efedf0f
commit b02d7e8cd8
No known key found for this signature in database
GPG key ID: 762CD40DD5349872

View file

@ -14,7 +14,7 @@ document.querySelector('.run')
}, false); }, false);
const loadProject = function () { const loadProject = function () {
let id = location.hash.substring(1); let id = location.hash.substring(1).split(',')[0];
if (id.length < 1 || !isFinite(id)) { if (id.length < 1 || !isFinite(id)) {
id = projectInput.value; id = projectInput.value;
} }
@ -310,7 +310,7 @@ class ProfilerRun {
dom: document.getElementsByClassName('profile-count-group')[0], dom: document.getElementsByClassName('profile-count-group')[0],
runningStats, runningStats,
maxRecordedTime: 6000 maxRecordedTime
}); });
const frames = this.frames = new Frames(profiler); const frames = this.frames = new Frames(profiler);
@ -388,10 +388,21 @@ window.onload = function () {
.innerText = progress.complete; .innerText = progress.complete;
}).on(storage); }).on(storage);
let warmUpTime = 4000;
let maxRecordedTime = 6000;
if (location.hash) {
const split = location.hash.substring(1).split(',');
if (split[1] && split[1].length > 0) {
warmUpTime = Number(split[1]);
}
maxRecordedTime = Number(split[2] || '0') || 6000;
}
new ProfilerRun({ new ProfilerRun({
vm, vm,
warmUpTime: 4000, warmUpTime,
maxRecordedTime: 6000 maxRecordedTime
}).run(); }).run();
// Instantiate the renderer and connect it to the VM. // Instantiate the renderer and connect it to the VM.