Skip to content

Commit 03b6b5f

Browse files
committed
Measure gcode execution time
1 parent c05f781 commit 03b6b5f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/interpreter.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export class Interpreter {
3030
* @returns The updated job instance
3131
*/
3232
execute(commands: GCodeCommand[], job = new Job()): Job {
33+
performance.mark('start execution');
3334
job.resumeLastPath();
3435
commands.forEach((command) => {
3536
if (command.gcode !== undefined) {
@@ -43,6 +44,8 @@ export class Interpreter {
4344
});
4445
job.finishPath();
4546

47+
performance.mark('end execution');
48+
const measure = performance.measure('execution', 'start execution', 'end execution');
4649
console.debug('Done processing gcode', measure.duration.toFixed(0) + 'ms');
4750
console.debug(this.retractions, 'retractions');
4851
console.debug(this.wipes, 'wipes');

0 commit comments

Comments
 (0)