# Initializing multiple timers within the draw loop ()

**URL:** https://discourse.processing.org/t/initializing-multiple-timers-within-the-draw-loop/35335
**Category:** Coding Questions
**Created:** [February 20, 2022, 10:45am UTC](https://discourse.processing.org/t/initializing-multiple-timers-within-the-draw-loop/35335 "2022-02-20T10:45:36Z")
**Posts on this page:** 1
**Showing post:** 9

<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: [February 20, 2022, 7:56pm UTC](https://discourse.processing.org/t/initializing-multiple-timers-within-the-draw-loop/35335/9 "2022-02-20T19:56:23Z")

</div>

Hello @basicvisual,

An example:

> [@Need assistance with timing! \[millis()\]](https://discourse.processing.org/t/need-assistance-with-timing-millis/18854/4):
>
> I provided a simple example: int whattimeisitnow; int whattimeisitatstartofstopwatch; int timepassedtoresetstopwatch = 1000; //setup runs once void setup() { whattimeisitatstartofstopwatch = millis(); } //draw loops 60 frames per sec void draw() { whattimeisitnow = millis(); if (whattimeisitnow \> whattimeisitatstartofstopwatch + timepassedtoresetstopwatch) { println("1000 ms have passed!"); whattimeisitatstartofstopwatch = millis(); //reset st…

Once you wrap your head around how this works it can be implemented in any way you want and with multiple timers.

This can be easily converted to p5.js.

`:)`

---

_[View the full topic](https://discourse.processing.org/t/initializing-multiple-timers-within-the-draw-loop/35335)._
