# Is millis() heavy on CPU program efficiency?

**URL:** <https://discourse.processing.org/t/is-millis-heavy-on-cpu-program-efficiency/23266>\
**Category:** p5.js\
**Created:** [August 14, 2020, 11:01pm UTC](https://discourse.processing.org/t/is-millis-heavy-on-cpu-program-efficiency/23266 "2020-08-14T23:01:07Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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 14, 2020, 11:33pm UTC](https://discourse.processing.org/t/is-millis-heavy-on-cpu-program-efficiency/23266/2 "2020-08-14T23:33:04Z")

</div>

Hello,

I can’t comment on efficiency…

In Processing I have used frameCount:

> [@Animation that transitions using frameCount](https://discourse.processing.org/t/animation-that-transitions-using-framecount/15378):
>
> A very simple example that transitions through scenes over time: // Author: GLV // Date: 2019-11-10 // Description: // Animate over time using frameCount // A very simple example that: // Uses frameCount to keep track of time // Fades in and out by modifying alpha component of HSB color // Cycles through HSB colors int scene = 0; int sec = 60; float alpha = 0; void setup() { size(500, 500); textSize(36); textAlign(CENTER, CENTER); colorMode(HSB, 360, 100, 100, 100); } void draw()…

> **[reference | p5.js](https://p5js.org/reference/#/p5/frameCount)**
>
> p5.js a JS client-side library for creating graphic and interactive experiences, based on the core principles of Processing.

I do not know how stable the frameRate is using P5.js on an Android.  
Your mileage may vary depending on what you’re sketch is doing; I often monitor frameRate to see if sketch is slowing things down and work to optimize code.

> **[reference | p5.js](https://p5js.org/reference/#/p5/frameRate)**
>
> p5.js a JS client-side library for creating graphic and interactive experiences, based on the core principles of Processing.

`:)`

---

_[View the full topic](https://discourse.processing.org/t/is-millis-heavy-on-cpu-program-efficiency/23266)._
