# How to made an object appear after a delay in p5.js

**URL:** <https://discourse.processing.org/t/how-to-made-an-object-appear-after-a-delay-in-p5-js/8074>\
**Category:** Coding Questions\
**Created:** [February 3, 2019, 5:44pm UTC](https://discourse.processing.org/t/how-to-made-an-object-appear-after-a-delay-in-p5-js/8074 "2019-02-03T17:44:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blkpanther](https://avatars.discourse-cdn.com/v4/letter/b/d9b06d/32.png) [@blkpanther](https://discourse.processing.org/u/blkpanther)\
**Post date:** [February 3, 2019, 5:44pm UTC](https://discourse.processing.org/t/how-to-made-an-object-appear-after-a-delay-in-p5-js/8074/1 "2019-02-03T17:44:11Z")

</div>

I intend to draw dilating circles. First a small circle appears on the center of the screen then radius increases and the circle enlarges, 2 seconds later another circle appears and also enlarges. At the same time there could be multiple concentric circles, looping infinitely.

This is the current code, but I have problems in making the 2nd circle appear 2sec after 1st circle, and 3rd circle 2sec after 2nd circle etc.

```auto
let w=500,h=500;
function setup() {
    createCanvas(w, h);
    background(255);
}

function draw() {
    r=10;
    ellipse(w/2,h/2, r*frameCount/2, r*frameCount/2);
    //2 seconds later, this new circle appear
    ellipse(w/2,h/2, r*frameCount/2, r*frameCount/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:** [February 4, 2019, 4:10am UTC](https://discourse.processing.org/t/how-to-made-an-object-appear-after-a-delay-in-p5-js/8074/2 "2019-02-04T04:10:28Z")

</div>

you need a timer!  
[https://editor.p5js.org/kll/sketches/87OpPvDWe](https://editor.p5js.org/kll/sketches/87OpPvDWe)
