# Renderer faster than JavaFX 2D

**URL:** <https://discourse.processing.org/t/renderer-faster-than-javafx-2d/42648>\
**Category:** Coding Questions\
**Created:** [August 24, 2023, 3:57am UTC](https://discourse.processing.org/t/renderer-faster-than-javafx-2d/42648 "2023-08-24T03:57:22Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![MrImskiy](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@MrImskiy](https://discourse.processing.org/u/MrImskiy)\
**Post date:** [August 26, 2023, 4:25pm UTC](https://discourse.processing.org/t/renderer-faster-than-javafx-2d/42648/22 "2023-08-26T16:25:00Z")

</div>

What is the reason behind writing `tNow = millis();` twice, i.e., once in `setup()` and once in `void requestData()`?

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [August 26, 2023, 4:54pm UTC](https://discourse.processing.org/t/renderer-faster-than-javafx-2d/42648/23 "2023-08-26T16:54:55Z")

</div>

It should have been `tLast = millis()` to initialize it in `setup()` as your starting time.

Consider and try ` tLast = 5000;` initialized in `setup()` before starting the `thread()` and observe what that will do.

Write some code with `millis()` in `setup()` (more than once and different locations) and` draw()` and use `println()` to examine the values.

I write a lot of simple snippets of code to examine how they work and a better programmer for it.

See the references for `setup()` and `draw()` as well to understand them.

Reference:

> **[millis() / Reference](https://processing.org/reference/millis_.html)**
>
> Returns the number of milliseconds (thousandths of a second) since starting the sketch. This information is often used for timing animation sequences.

`:)`

[Previous page](https://discourse.processing.org/t/renderer-faster-than-javafx-2d/42648.md?page=1)
