# Keep P3D running when surface is not visible

**URL:** https://discourse.processing.org/t/keep-p3d-running-when-surface-is-not-visible/9896
**Category:** Coding Questions
**Created:** [April 2, 2019, 10:04pm UTC](https://discourse.processing.org/t/keep-p3d-running-when-surface-is-not-visible/9896 "2019-04-02T22:04:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![clankill3r](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/clankill3r/32/1098_2.png) [@clankill3r](https://discourse.processing.org/u/clankill3r)
#### Post date: [April 2, 2019, 10:04pm UTC](https://discourse.processing.org/t/keep-p3d-running-when-surface-is-not-visible/9896/1 "2019-04-02T22:04:59Z")

</div>

Is there a way to keep P3D running when the surface is not visible?

```auto
void setup() {
  size(600, 600, P3D);
  PSurfaceJOGL surface = (PSurfaceJOGL) getSurface();
  surface.setVisible(false);
}

void draw() {
   println(frameCount); 
}

```

---

<div class="post-metadata">

### Author: ![TechEpic](https://avatars.discourse-cdn.com/v4/letter/t/a87d85/32.png) [@TechEpic](https://discourse.processing.org/u/TechEpic)
#### Post date: [April 3, 2019, 2:19am UTC](https://discourse.processing.org/t/keep-p3d-running-when-surface-is-not-visible/9896/2 "2019-04-03T02:19:34Z")

</div>

In theory, you could make a separate thread that has access to your main class and have it call draw() every 1/60th of a second (or whatever your frame rate is).
