> For the complete documentation index, see [llms.txt](https://docs.keyfax.biz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keyfax.biz/product-suite/admin/databox-examples/script-duration.md).

# Script Duration

This Databox reads from a [System Values](/product-suite/admin/entities/databoxes/system-values.md) **Databox** that represents the current date and time and stores this in the Databox **Keyfax.Timer started** at the point that you wish to start timing.&#x20;

### Databox Creation

You will first need to create the [System Values](/product-suite/admin/entities/databoxes/system-values.md) Databox as shown below\...

<div align="center"><figure><img src="/files/gi3Sj6nq1p123yTA7PLr" alt=""><figcaption><p>The current date and time</p></figcaption></figure></div>

<div align="center"><figure><img src="/files/SJCEhsTyydEeqz9c8jUr" alt=""><figcaption><p>Recording exactly when the timer started...</p></figcaption></figure></div>

<div align="center"><figure><img src="/files/uMP36D8qIlyLK40jkgmC" alt=""><figcaption><p>Calculating the difference using a SQL query</p></figcaption></figure></div>

### End Result

This can be demonstrated in a simple script comprising 3 steps. The first saves the current time, the second is a random question and the third displays a message showing the time spent. &#x20;

<figure><img src="/files/CNBhwMKEv0NMrX1WL7q3" alt=""><figcaption><p>Demonstrating how to use the timer</p></figcaption></figure>

Here is the message...

<figure><img src="/files/IgLSrTL37BFxy00Zy3Sm" alt=""><figcaption><p>The Message used in the above script</p></figcaption></figure>

And the final output...

<figure><img src="/files/DUdmJzqe98psrOXeZtVH" alt=""><figcaption><p>Message showing results of time spent in script</p></figcaption></figure>

{% hint style="info" %}
**NOTE:** The actual time spent in the script may be usefully returned to the host or calling application. The timer would normally be started in a **Startup Script** and the number of seconds could be returned to the host in a **Results Script**.
{% endhint %}
