MCPcopy Index your code
hub / github.com/aiscript-dev/aiscript / countSleeps

Function countSleeps

test/interpreter.ts:171–190  ·  view source on GitHub ↗
(irqRate: number)

Source from the content-addressed store, hash-verified

169describe('IRQ', () => {
170 describe('irqSleep is function', () => {
171 async function countSleeps(irqRate: number): Promise<number> {
172 let count = 0;
173 const interpreter = new Interpreter({}, {
174 irqRate,
175 // It's safe only when no massive loop occurs
176 irqSleep: async () => count++,
177 });
178 await interpreter.exec(Parser.parse(`
179 'Ai-chan kawaii'
180 'Ai-chan kawaii'
181 'Ai-chan kawaii'
182 'Ai-chan kawaii'
183 'Ai-chan kawaii'
184 'Ai-chan kawaii'
185 'Ai-chan kawaii'
186 'Ai-chan kawaii'
187 'Ai-chan kawaii'
188 'Ai-chan kawaii'`));
189 return count;
190 }
191
192 test.concurrent.each([
193 [0, 0],

Callers 1

interpreter.tsFile · 0.85

Calls 2

execMethod · 0.95
parseMethod · 0.45

Tested by

no test coverage detected