mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Read benchmark warm up time and recording time from uri
This commit is contained in:
parent
980efedf0f
commit
b02d7e8cd8
1 changed files with 15 additions and 4 deletions
|
@ -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.
|
||||||
|
|
Loading…
Reference in a new issue