setRatio method
Calculate ratio against another test
Implementation
void setRatio(PerfTestOne versus) {
final value1 = value;
final value2 = versus.value;
if (value1 == value2) {
ratio = 1;
} else if (value2 == 0) {
ratio = format.infinity ?? -1;
} else {
ratio = (value1 / value2);
}
outRatio = (ratio < 0 ? '' : format.percent(ratio));
}