We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
interruptAndCheck
1 parent f8dadea commit a829dfdCopy full SHA for a829dfd
packages/langium/src/utils/promise-utils.ts
@@ -78,6 +78,10 @@ export async function interruptAndCheck(token: CancellationToken): Promise<void>
78
if (current - lastTick >= globalInterruptionPeriod) {
79
lastTick = current;
80
await delayNextTick();
81
+ // prevent calling delayNextTick every iteration of loop
82
+ // where delayNextTick takes up the majority or all of the
83
+ // globalInterruptionPeriod itself
84
+ lastTick = performance.now();
85
}
86
if (token.isCancellationRequested) {
87
throw OperationCancelled;
0 commit comments