# Is there a method to force the UI to update like requestAnimationFrame()?

**URL:** <https://forums.creativeclouddeveloper.com/t/is-there-a-method-to-force-the-ui-to-update-like-requestanimationframe/555>\
**Category:** UXP Plugin API\
**Tags:** api-feedback\
**Created:** [January 7, 2019, 10:25pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-method-to-force-the-ui-to-update-like-requestanimationframe/555 "2019-01-07T22:25:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Velara](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/velara/32/1278_2.png) [@Velara](https://forums.creativeclouddeveloper.com/u/Velara)\
**Post date:** [January 7, 2019, 10:25pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-method-to-force-the-ui-to-update-like-requestanimationframe/555/1 "2019-01-07T22:25:23Z")

</div>

I have a loop that freezes the UI for a few seconds. Until `setTimeout` and `setInterval` is available is there a way to request that the UI of the plugin be update?

For example,

```
myLabel.text = "Running process...please wait";
for (var i=0;i<100k;i++) {
    // run through artboards 
}

```

In the example above the label is not updated until midway? to or after the `for loop` ends. The update method would force the display to be drawn. It could be async.

```
myLabel.text = "Running process...please wait";
requestAnimationFrame(); // update the UI
for (var i=0;i<100k;i++) {
    // run through artboards 
}
```

---

<div class="post-metadata">

**Author:** ![kerrishotts](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/kerrishotts/32/8_2.png) [@kerrishotts](https://forums.creativeclouddeveloper.com/u/kerrishotts)\
**Post date:** [January 8, 2019, 7:23pm UTC](https://forums.creativeclouddeveloper.com/t/is-there-a-method-to-force-the-ui-to-update-like-requestanimationframe/555/2 "2019-01-08T19:23:55Z")

</div>

I don’t know of an easy way here short of using a dummy network or file I/O request… I _think_ those would insert enough asynchrony to give the UI time to update, but I’m not sure if it would be consistent or not across machines with different performance profiles.
