Skip to content
Snippets Groups Projects
Commit c2769a7c authored by marihachi's avatar marihachi
Browse files

show parsing time

parent f5d22b74
No related branches found
No related tags found
No related merge requests found
import { performance } from 'perf_hooks';
import inputLine, { InputCanceledError } from './misc/inputLine';
import { parse } from '..';
......@@ -24,8 +25,12 @@ async function entryPoint() {
.replace(/\\u00a0/g, '\u00a0');
try {
const parseTimeStart = performance.now();
const result = parse(input);
const parseTimeEnd = performance.now();
console.log(JSON.stringify(result));
const parseTime = (parseTimeEnd - parseTimeStart).toFixed(3);
console.log(`parsing time: ${parseTime}ms`);
}
catch (err) {
console.log('parsing error:');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment