> For the complete documentation index, see [llms.txt](https://learnpython.strivemath.com/p5-python-web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learnpython.strivemath.com/p5-python-web/reference/built-in-functions/millis.md).

# millis()

### Example

<figure><img src="/files/BGWN8kzEECdg5B22oXck" alt=""><figcaption></figcaption></figure>

```python
text('Milliseconds since starting this sketch:',200,250)
text(millis(), width/2, height/2)
```

### **Syntax**

`millis()`

### **Description**

The `millis()` function works by keeping track of the number of **milliseconds** that have passed since the program **started running**.

You can use this in your program to create time-based behaviors.

{% hint style="info" %}
Find these documents helpful? Let the people who made them help your child learn to code at [**Strivemath**](https://www.strivemath.com/)<mark style="color:blue;">**!**</mark>

We'd love to hear your Feedback/Comments [here](https://docs.google.com/forms/d/e/1FAIpQLSeqorBAGTya-YBRI-VFjJxtgQtCz3ucGDI96K96sNyuaGuvdw/viewform?usp=sf_link).
{% endhint %}
