mwg API
    Preparing search index...

    Class InstructionBudget

    A count of emulated instructions an emulator spends as it runs. The emulator calls spend from its dispatch loop (once per instruction, or once per batch); past the allowance it throws, so a tune that loops forever without producing sound ends the render instead of hanging it.

    import { InstructionBudget } from '@datamoc/mwg/audio';

    const budget = InstructionBudget.forSeconds(30);
    function runFrame(cycles: number): void {
    budget.spend(cycles);
    }
    runFrame(20000);
    console.log(budget.remaining);
    Index