# Need help creating a function that delays draw()

**URL:** <https://discourse.processing.org/t/need-help-creating-a-function-that-delays-draw/24839>\
**Category:** Coding Questions\
**Created:** [October 23, 2020, 7:14am UTC](https://discourse.processing.org/t/need-help-creating-a-function-that-delays-draw/24839 "2020-10-23T07:14:49Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [October 23, 2020, 10:51am UTC](https://discourse.processing.org/t/need-help-creating-a-function-that-delays-draw/24839/3 "2020-10-23T10:51:42Z")

</div>

Hello,

Start working with a simple timer first and understand that.  
Then work on integrating into your code.

> [@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…

`:)`

---

_[View the full topic](https://discourse.processing.org/t/need-help-creating-a-function-that-delays-draw/24839)._
