# Making a for loop ( or timer )

**URL:** <https://discourse.processing.org/t/making-a-for-loop-or-timer/6483>\
**Category:** Coding Questions\
**Created:** [December 10, 2018, 4:45pm UTC](https://discourse.processing.org/t/making-a-for-loop-or-timer/6483 "2018-12-10T16:45:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [December 10, 2018, 4:58pm UTC](https://discourse.processing.org/t/making-a-for-loop-or-timer/6483/2 "2018-12-10T16:58:12Z")

</div>

a simple timer only:

```auto
// ..
long startT, stopT=15000;

void setup() {
// ..
  startT = millis();
}

void draw() {
//...
  if ( millis() > startT + stopT ) {
    startT = millis();
    println("_next loop_");
    // do some reset her....
    background(255, 244, 206);
  }
} 

```

---

_[View the full topic](https://discourse.processing.org/t/making-a-for-loop-or-timer/6483)._
