refactor(debug-repeat): use built-in int type (#4791)
parent
b9fb113b3b
commit
e9f489cea1
|
@ -124,7 +124,7 @@ const options = {
|
||||||
},
|
},
|
||||||
"debug-repeat": {
|
"debug-repeat": {
|
||||||
// Repeat the formatting a few times and measure the average duration.
|
// Repeat the formatting a few times and measure the average duration.
|
||||||
type: "number",
|
type: "int",
|
||||||
default: 0
|
default: 0
|
||||||
},
|
},
|
||||||
editorconfig: {
|
editorconfig: {
|
||||||
|
|
|
@ -221,8 +221,8 @@ function format(context, input, opt) {
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.run({ async: false });
|
.run({ async: false });
|
||||||
} else if (+context.argv["debug-repeat"] > 0) {
|
} else if (context.argv["debug-repeat"] > 0) {
|
||||||
const repeat = +context.argv["debug-repeat"];
|
const repeat = context.argv["debug-repeat"];
|
||||||
context.logger.debug(
|
context.logger.debug(
|
||||||
"'--debug-repeat' option found, running formatWithCursor " +
|
"'--debug-repeat' option found, running formatWithCursor " +
|
||||||
repeat +
|
repeat +
|
||||||
|
@ -238,7 +238,7 @@ function format(context, input, opt) {
|
||||||
}
|
}
|
||||||
const averageMs = totalMs / repeat;
|
const averageMs = totalMs / repeat;
|
||||||
const results = {
|
const results = {
|
||||||
repeat: repeat,
|
repeat,
|
||||||
hz: 1000 / averageMs,
|
hz: 1000 / averageMs,
|
||||||
ms: averageMs
|
ms: averageMs
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue