Home > @i2analyze/notebook-sdk > app > IStatus > setProgress
app.IStatus.setProgress() method
Reports numeric progress and optionally yields the UI thread to keep the application responsive.
Signature:
setProgress(done: number, total: number): Promise<void>;
Introduced: version 1.9
Parameters
| Parameter | Type | Description |
|---|---|---|
| done | number | The amount of work completed so far. |
| total | number | The total amount of work. When greater than 0, a determinate progress bar is shown. |
Returns:
Promise<void>
A promise that resolves after optionally yielding the UI thread.
Remarks
Use this method in tight loops to show a determinate progress bar and prevent the application from becoming unresponsive. The returned promise should be awaited on each iteration.
To yield the UI thread without showing a progress bar (when the total is not known), pass 0 for both done and total.