this.metrics = [];
Config.forceSyncSaving = true;
var SAVES = 50;
// measure a couple of saves.
for(var j=0; j<SAVES; j++) {
this.world().saveWorld();
var save = {
serialization: Config.lastSaveSerializationTime,
linearization: Config.lastSaveLinearizationTime,
transfer: Config.lastSaveTransferTime,
total: Config.lastSaveTime
};
this.metrics.push(save);
}
// render result CSV.
var result = "Linearization,Serialization,Transfer,Total";
for(var i=0; i<this.metrics.length; i++) {
var current = this.metrics[i];
result += "\n";
result += current.linearization;
result += ",";
result += current.serialization;
result += ",";
result += current.transfer;
result += ",";
result += current.total;
}
$morph('Result').setTextString(result);