# Why is frameRate limited when Processing runs in a window?

**URL:** <https://discourse.processing.org/t/why-is-framerate-limited-when-processing-runs-in-a-window/23719>\
**Category:** Coding Questions\
**Created:** [September 6, 2020, 10:55pm UTC](https://discourse.processing.org/t/why-is-framerate-limited-when-processing-runs-in-a-window/23719 "2020-09-06T22:55:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shwaa](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/shwaa/32/9696_2.png) [@Shwaa](https://discourse.processing.org/u/Shwaa)\
**Post date:** [September 6, 2020, 10:55pm UTC](https://discourse.processing.org/t/why-is-framerate-limited-when-processing-runs-in-a-window/23719/1 "2020-09-06T22:55:19Z")

</div>

I’m working on a project in P3D, and I noticed something about performance when the window isn’t focused: the framerate _immediately_ jumps up. I’m working on a relatively beefy PC, so I don’t consider myself limited by performance. When loading and running this simple sketch:

```auto
void setup() {
  size(1600, 900, P2D);
  frameRate(999);
  textSize(69);
  textAlign(LEFT, TOP);
}
void draw() {
  background(0);
  fill(255);
  text("FPS:" + frameRate, 0, 11);
}

```

I get 75 fps (the refresh rate of my monitor) when I am focused on the window. But, when I open another window on top of the processing sketch, the framerate jumps into the 900s. I’ve narrowed the cause of this to the P2D/P3D renderer itself because using the default renderer doesn’t have this limitation. Additionally, this limitation causes frame drops every once in a while, so I’m inclined to disable it. I don’t know the cause of this, or if it can be disabled, but if anyone has some insight I’d be happy to know.

[EDIT]  
Insight gathered: when running rocket league in fullscreen, the framerate is unlimited. When running rocket league windowed, the framerate caps at 75 fps. So, by that observation, the window itself is limiting the framerate. So, replacing `size()` with `fullScreen()` should make the framerate unlimited, and lo and behold, it does. In the context of making a game, it is another thing to put into an options menu.
