Common Tools Time Budget

Definition

Creation

The timeBudget is defined as follows.

The creation code is as follows.

Process

Bonus

After the timeBudget starts running, a work collaboration is created. In this coroutine, the budget increase operation will be triggered once a second. If the budget is greater than the upper limit, the upper limit is taken.

Take & Return

The takeAvailable acquires all budgets at a time and resets the budget. The returnUnused returns the remaining budget.

Last updated