68kcounter
Version:
68000 ASM source code cycle counter
45 lines (44 loc) • 963 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.lengthLevel = exports.timingLevel = exports.Levels = void 0;
/**
* Warning level timing/length display
*/
exports.Levels = {
VHigh: "vhigh",
High: "high",
Med: "med",
Low: "low",
};
/**
* Get warning level for timing
*/
function timingLevel(timing) {
if (timing[0] > 30) {
return exports.Levels.VHigh;
}
if (timing[0] > 20) {
return exports.Levels.High;
}
if (timing[0] >= 12) {
return exports.Levels.Med;
}
return exports.Levels.Low;
}
exports.timingLevel = timingLevel;
/**
* Get warning level for byte length
*/
function lengthLevel(bytes) {
if (bytes > 6) {
return exports.Levels.VHigh;
}
if (bytes > 4) {
return exports.Levels.High;
}
if (bytes === 4) {
return exports.Levels.Med;
}
return exports.Levels.Low;
}
exports.lengthLevel = lengthLevel;